Skip to content

hlee/gnap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gnap
/næp/

Gnap is an interface to Gnip’s api. It has not been written yet. The following code is how I hope to make it work, and is subject to change.


require 'gnap'
gnap = Gnap.new("username", "password")

# current notifications stream for twitter
gnap.publishers("twitter").notifications

# five minutes ago
gnap.publishers("twitter").notifications(5.minutes.ago)

# from a filter
gnap.publishers("twitter").filter("bobs_rule").notifications(5.minutes.ago)

# gnip doesn't appear to me to support time ranges, so I don't.
# one call to notifications == one request!


# create a new filter
gnap.publishers("twitter").create_filter!("bobs_rule", :actor => "some actor rule text")

# add a rule
gnap.publishers("twitter").filter("bobs_rule").add_rule!("actor", "bob")

# add several rules
gnap.publishers("twitter").filter("bobs_rule").add_rules!({"actor" => ["bob", "steve", "alan", "and so on"])


About

Interface to Gnip api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published