Is there a Twitter Streams API for Ruby? - ruby

Does anyone know of a Ruby gem or plugin that provides a simple interface to the Twitter Steams API?

Try TweetStream: https://github.com/intridea/tweetstream

Twitter Gem has added streaming functionality.
you can check that out

Related

AngularJS and Google Ajax Crawler

So basically I am trying to get angularJs Routes to look like this
www.example.com/ajax.html#!product=1234
instead of like this
www.example.com/ajax.html#/product/1234
is there any hope?
You just have to configure the $location service and call:
$locationProvider.hashPrefix("!")
If your running a ruby app and want to adhere to the google ajax crawling scheme - there's a gem that implements the crawling scheme for any rack app....
gem install google_ajax_crawler
writeup of how to use it is at http://thecodeabode.blogspot.com.au/2013/03/backbonejs-and-seo-google-ajax-crawling.html, source code at https://github.com/benkitzelman/google-ajax-crawler

Api for google-api-client gem

How do I get the api of this gem? I could currently get the name and email of the user with
google_client.execute!(:api_method => GoogleLogic.get_google_oauth2.userinfo.get).data.name
google_client.execute!(:api_method => GoogleLogic.get_google_oauth2.userinfo.get).data.email
but no where are these methods written in the official page of this gem
http://code.google.com/p/google-api-ruby-client/
Since the ruby client is generated dynamically, it may not have API docs. You can see the API definition here:
https://www.googleapis.com/discovery/v1/apis/oauth2/v1/rest
It might be useful to you to see what methods/attributes are generated in the library.
Not sure if this is relevant anymore, but I found the documentation on the github page quite useful:
https://github.com/google/google-api-ruby-client
And also the samples:
https://github.com/google/google-api-ruby-client-samples
Lastly, the developers console in google is very useful.
http://console.developers.google.com/

Best Picasa gem for Ruby?

Is there any gem for the Picasa API? I've tried to use github.com/morgoth/picasa, but this gem does not support authorized requests.
These are my findings about Gems for Picasa in ruby on rails.
https://github.com/pangloss/ruby_picasa
https://github.com/morgoth/picasa
The second one is new and will help you, best of luck.
If still interested, you can use http://picasaonrails.googlecode.com/ It allows uploading and album creation
check http://picasaonrails.googlecode.com/svn/trunk/picasa_on_rails/README for use samples
To use it you can install as a plugin or just download http://picasaonrails.googlecode.com/svn/trunk/picasa_on_rails/lib/picasa.rb and http://picasaonrails.googlecode.com/svn/trunk/picasa_on_rails/lib/multipartpost.rb for any ruby (not rails) project
I'm a contributor. I don't know if it's the best, but I use it in production: https://github.com/mkraft/PicasaWebAlbums

Ruby libs for Twitter User/Site streams?

Are there any ruby libs to handle twitter user / site streams?
the twitter-stream gem can do that.
http://rubygems.org/gems/twitter-stream
https://github.com/scootklein
currently has user streams, working on site streams (very much beta, and planning on integrating back into the parent fork)

Twitter/Facebook API for Ruby

I want to write a Ruby application through which:
I can submit tweets to twitter.
I can submit a post to facebook.
I can manage real-time stats of tweets
Is there any twitter/facebook api for Ruby?
I use the Twitter gem and am quite happy with it.
For Facebook, there is the Facebooker gem.
Streams of tweets:
Tweetmon is a great gem for keeping real-time track of tweets. Here's an example of using it to get a stream of tweets on a specific keyword
#!/usr/local/bin/ruby
if ARGV.size==1
keyword = ARGV.shift
else
puts 'tweetmon usage: tweetmon <keyword>'
exit 1
end
require 'yaml'
require 'rubygems'
require 'tweetstream'
config = YAML::load(File.open(File.expand_path('~/.twitter')))
user =config['username']
password =config['password']
TweetStream::Client.new(user,password).track(keyword) do |status|
puts "[#{status.created_at}-#{status.user.screen_name}] #{status.text}"
end
To use this gem you need:
gem sources -a http://gems.github.com
gem install intridea-tweetstream
To submit a tweet is just a HTTP POST - doesn't need any extra libraries to do this.
The Twitter API is a RESTful web service. It's completely language agnostic. Use whatever language you want.
Not sure about Facebook.
Two more libraries that didn't get mentioned yet:
twitter4r: http://twitter4r.rubyforge.org/
Twibot: http://cjohansen.no/en/ruby/twibot_a_microframework_for_twitter_bots_in_ruby
If you're inclined to retain more control over how you use the Twitter and Facebook APIs you can use the Wrest gem.
Take a look at the facebook (http://is.gd/bJspX) and twitter (http://is.gd/bJsqV) examples.
Also, while both the Twitter and Facebook APIs are HTTP APIs, they are not RESTful despite their claims to the contrary.
I would use this gem, it's really helpful https://github.com/moomerman/twitter_oauth
or just gem install twitter_oauth
MiniFB https://github.com/appoxy/mini_fb is excellent for Facebook API. But in both APIs you can do everything through HTTPParty and OAuth.

Resources