Skip to content

Instantly share code, notes, and snippets.

@smallfield
Created October 19, 2015 22:37
Show Gist options
  • Save smallfield/47e0b48c34c2791bd34a to your computer and use it in GitHub Desktop.
Save smallfield/47e0b48c34c2791bd34a to your computer and use it in GitHub Desktop.
#!/usr/local/bin/ruby
require 'twitter'
target = {"2000" => "2千位",
"10000" => "1万位",
"20000" => "2万位",
"50000" => "5万位",
"100000" => "10万位"
}
if ARGV[0] == "config"
puts "graph_title Cinderella Girls SLS Event Border"
puts "graph_vlabel Event points"
puts "2000.label 2,000"
puts "10000.label 10,000"
puts "20000.label 20,000"
puts "50000.label 50,000"
puts "100000.label 100,000"
exit 0
end
client = Twitter::REST::Client.new do |config|
config.consumer_key = ""
config.consumer_secret = ""
end
client.user_timeline("deresute_border", { count: 1} ).each do |timeline|
tweet = client.status timeline.id
text = tweet.text.split "\n"
target.each {|value, japanese|
target = text.grep /^#{japanese}.*/
next if target == nil || target.length == 0
target = target[0]
target = target.gsub(/.*:/, "").gsub(/[(][^)]*[)]/, "")
puts "#{value}.value #{target}"
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment