-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic example about using grackle to communicate with twitter
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
# grackle is small libary to access twitter, retrieve data from it, send data to twitter and more. | ||
# find out more about grackle here: http://github.com/hayesdavis/grackle | ||
require 'rubygems' | ||
require 'grackle' | ||
|
||
# To communicate with twitter we need a client. | ||
# yes, it's this simple, all boring things are hidden | ||
client = Grackle::Client.new | ||
|
||
# First let's see for some information about a User | ||
puts y client.user.show('TomK32') | ||
|
||
# We can also search | ||
puts y client.search? :q => 'ruby twitter' | ||
|
||
|
||
# here you have to change the username and password | ||
client = Grackle::Client.new(:auth=>{:type=>:basic,:username=>'yourusername',:password=>'yourpassword'}) | ||
|
||
# and now you can put a new status | ||
client.statuses.update! :status=>'this status is from my grackle client' | ||
|
||
# Want to try more, read the official API and just try out. http://apiwiki.twitter.com/Twitter-API-Documentation |