Skip to content

Commit

Permalink
Basic example about using grackle to communicate with twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK32 committed Nov 26, 2009
1 parent 6e8c56c commit a202457
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions grackle-client-server-communication.rb
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

0 comments on commit a202457

Please sign in to comment.