Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (16 sloc) 0.875 kb
a202457 @TomK32 Basic example about using grackle to communicate with twitter
authored
1
2 # grackle is small libary to access twitter, retrieve data from it, send data to twitter and more.
3 # find out more about grackle here: http://github.com/hayesdavis/grackle
4 require 'rubygems'
5 require 'grackle'
6
7 # To communicate with twitter we need a client.
8 # yes, it's this simple, all boring things are hidden
9 client = Grackle::Client.new
10
11 # First let's see for some information about a User
12 puts y client.user.show('TomK32')
13
14 # We can also search
15 puts y client.search? :q => 'ruby twitter'
16
17
18 # here you have to change the username and password
19 client = Grackle::Client.new(:auth=>{:type=>:basic,:username=>'yourusername',:password=>'yourpassword'})
20
21 # and now you can put a new status
22 client.statuses.update! :status=>'this status is from my grackle client'
23
24 # Want to try more, read the official API and just try out. http://apiwiki.twitter.com/Twitter-API-Documentation
Something went wrong with that request. Please try again.