Created
March 26, 2013 13:51
-
-
Save bkenny/5245515 to your computer and use it in GitHub Desktop.
Post a tweet with the most popular Spot from yesterday - http://www.spots.io
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 'gauges' | |
require 'rubygems' | |
require 'active_support/all' | |
require 'twitter' | |
@client = Gauges.new(:token => api_token) | |
@results = @client.content(gauge_id, :date => Date.yesterday) | |
@results['content'].each do |content| | |
if content['url'].include?('/venue') | |
@title = content['title'] | |
@url = content['url'] | |
break | |
end | |
end | |
Twitter.configure do |config| | |
config.consumer_key = consumer_key | |
config.consumer_secret = consumer_secret | |
config.oauth_token = oauth_token | |
config.oauth_token_secret = oauth_token_secret | |
end | |
Twitter.update("Popular Spot Yesterday: #{@title} #{@url}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment