Google plus streams from terminal


Hi friends,

Are you linux user ?

Get your streams of  google+ via terminal in few steps.. Written script using ruby with help of  Mechanize. We can specify circle which we want to display.

This will display all the stream of our friends.

Usage:

ruby gplus.rb sathia2704 password Friends

Dependencies: ruby, rubygems, mechanize

Ruby code

=begin
Program name: Gplus script
Date Written: 16/08/2011
Date Modified: 16/08/2011
Author : Sathianarayanan.S
License: GPL2.0
=end
begin
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari'
page = agent.get("https://www.google.com/accounts/ServiceLogin?service=oz&continue=https://plus.google.com/?gpcaz%3D94cd3e2c&ltmpl=es2st&hideNewAccountLink=1&hl=en-GB")
form = page.forms.first
form.Email = ARGV[0]
form.Passwd = ARGV[1]

page = agent.submit form
page = agent.page.link_with(:text => ARGV[2]).click

streams = page.search('#contentPane div.sj div.eo')

i = 1
streams.each do |stream|
  if stream.text != ''
    puts i.to_s+') '+stream.text
  else
   puts  i.to_s+') '+'Video/photos...'
  end
  puts ''
  i+=1
end
rescue SocketError
 puts 'Error in internet connection'
end

Output

Advertisements

About sathia

Web developer at cloudmint
This entry was posted in programs and tagged , , , , , , , , , . Bookmark the permalink.

6 Responses to Google plus streams from terminal

  1. Do you have similar code for Perl?

  2. superb post… keep rocking sathiya 🙂

  3. Ramachandran says:

    Wow. Its really cool.:)
    Keep Rocking…

  4. Nice post :). Btw how can i post on google stream through programatically? can u help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s