Skip to content

Instantly share code, notes, and snippets.

View Najaf's full-sized avatar

Ali Najaf

View GitHub Profile
#! /usr/bin/env ruby
require 'csv'
tweet = "Chocolate makes me happy, it makes my life wonderful"
tweetsplit = tweet.downcase.split(/\W+/)
valences! = []
for tweetsplit do |i|
curl http://crr.ugent.be/papers/Ratings_Warriner_et_al.csv > ratings.csv
require 'csv'
CSV.foreach("./ratings.csv") do |row|
puts [row[1], row[3]].inspect
end
@Najaf
Najaf / positivity
Last active August 29, 2015 13:56
#! /usr/bin/env ruby
require "twitter"
require 'csv'
require 'regexp'
# Twitter setup was here...
#Gets the last 10 tweets from a given user from the twitter API
screen_name = String.new ARGV[0]
#! /usr/bin/env ruby
require "twitter"
require 'csv'
require 'regexp'
# Twitter setup was here...
#Gets the last 10 tweets from a given user from the twitter API
screen_name = String.new ARGV[0]
#! /usr/bin/env ruby
require "twitter"
require 'csv'
require 'regexp'
# Twitter setup was here...
#Gets the last 10 tweets from a given user from the twitter API
screen_name = String.new ARGV[0]
#! /usr/bin/env ruby
require "twitter"
require 'csv'
require 'regexp'
# Twitter setup was here...
#Gets the last 10 tweets from a given user from the twitter API
screen_name = String.new ARGV[0]
require 'fileutils'
# constants for site generation
PUBLIC_DIR = 'public/'
CONTENT_DIR = 'content/'
LAYOUT = 'views/layout.erb'
namespace :site do
task :clear do
FileUtils.rm_rf "#{PUBLIC_DIR}/*"
namespace :admin do
task :list_users do
User.all.each { |u| puts [u.name, u.email, u.created_at].join(' | ') }
end
task :show_stats do
puts Stats.todays_traffic
end
end
puts 'hello world'