This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
CSV.foreach("./ratings.csv") do |row| | |
puts [row[1], row[3]].inspect | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://crr.ugent.be/papers/Ratings_Warriner_et_al.csv > ratings.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'csv' | |
tweet = "Chocolate makes me happy, it makes my life wonderful" | |
tweetsplit = tweet.downcase.split(/\W+/) | |
valences = [] | |
tweetsplit.each do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'csv' | |
tweet = "Chocolate makes me happy, it makes my life wonderful" | |
tweetsplit = tweet.downcase.split(/\W+/) | |
valences = [] | |
tweetsplit.each do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'csv' | |
#Initialised the hash to store the valence values | |
valence_index = {} | |
CSV.foreach("./ratings.csv") do |row| | |
valence_index[row[1]] = row[2] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def this_method_takes_three_arguments(a, b, c) | |
# do stuff with three arguments | |
end | |
# Now imagine you had an array that contained the three arguments that | |
# you wanted to pass into the above method: | |
arguments = ['foo', 'bar', 'baz'] | |
# You could pass them in like this: |