Created
March 3, 2010 03:00
-
-
Save hoverbird/320261 to your computer and use it in GitHub Desktop.
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 "twitter" | |
myname = "hoverbird" | |
pw = "secretpasswordhere" | |
auth = Twitter::HTTPAuth.new(myname, pw) | |
t = Twitter::Base.new(auth) | |
# If your client (stored in the variable t) is connected, this should work | |
me = t.user(myname) | |
# use pp for better readability | |
pp me | |
# Checking following status | |
t.friendship_exists?(myname, "oprah") | |
t.friendship_exists?("oprah", "ev") | |
# tweeting | |
t.update("This string will be my next tweet, use with care!") | |
# Some timelines | |
mytweets = t.user_timeline | |
friendstweets = t.friends_timeline | |
replies = t.replies | |
# Trends | |
trends = Twitter::Trends.current | |
trends = Twitter::Trends.current(:exclude => 'hashtags') | |
#Search | |
# ( the syntax here is a little advanced, don't worry too much if it doesn't make sense yet ) | |
justin = "justinbieber" | |
search = Twitter::Search.new('marry me').collect | |
search = Twitter::Search.new("marry me").to(justin).collect | |
search = Twitter::Search.new('marry me').to(justin).collect {|tweet| tweet.text } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment