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
source 'https://rubygems.org' gem 'rack' |
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
screen_name = String.new ARGV[0] | |
user = client.user(screen_name) | |
tweet = client.user_timeline(screen_name).first | |
count = client.user(count) | |
puts tweet.text |
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
#Gets the last 10 tweets from a given user from the twitter API | |
screen_name = String.new ARGV[0] | |
#for each tweet | |
tweet = client.user_timeline(screen_name, count: 10).each do |tweet| | |
#Look through each row in the CSV file to see if any words in the tweet match the words in the 2nd element of the csv array(the word) | |
csv = CSV.foreach("csvratings.csv", {:headers=>true}).each do |row| | |
#For each line if the word matches words in the tweet then create a new array and put the valence mean value (3rd array element) in it. |
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
class Tweet | |
def tweets(string) | |
@tweet = string | |
end | |
def tweetsplit | |
@tweet.split('/w') | |
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
tweet = "Thisis a tweet" | |
tweetsplit = tweet.split('\w') | |
puts tweetsplit |
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
tweet = "This is, a tweet" | |
tweetsplit = tweet.split('\w') | |
puts tweetsplit |
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! = [] | |
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
%nav.navbar.navbar-default | |
.container-fluid | |
.navbar-header | |
%span.navbar-brand | |
=link_to 'Users', admin_users_path | |
| | |
=link_to 'Invitations', admin_invitations_path | |
.collapse.navbar-collapse | |
.navbar-right | |
= link_to 'Log out', admin_session_path, method: 'delete', class: 'btn btn-sm btn-default navbar-btn' |
OlderNewer