In previous post, when I run gplus script it will display
the stream from circle we mentioned in command
eg. ruby gplus.rb username password circle_name
In this version , It will prompt for username and password .. and it displays all circle names of
current user .. and we can see streams of any circle shown
Dependencies:
ruby, rubygems, mechanize(gem), highline (gem for secure password)
Ruby code
=begin
Program name: Gplus script
Date Written: 16/08/2011
Date Modified: 17/08/2011
Author : Sathianarayanan.S
License: GPL2.0
Version: 1.1
=end
begin
require 'rubygems'
require 'mechanize'
require "highline/import"
print "Enter your username: "
username = gets.chomp
password = ask("Enter the password :" ) { |p| p.echo = "*" }
password = password.chomp
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<mpl=es2st&hideNewAccountLink=1&hl=en-GB")
puts 'Logggig....'
puts "=========================================================================\n"
form = page.forms.first
form.Email = username
form.Passwd = password
page = agent.submit form
circles = agent.page.search('#content .c-j.a-nb-j.a-nb-Jh-j')
puts 'Streams:'
i = 1
circles.each do |circle|
puts i.to_s+') '+circle
i+=1
end
puts "=========================================================================\n"
while true
print "Enter circle: "
circle_name = gets.chomp
page = agent.page.link_with(:text => circle_name).click
streams = page.search('#contentPane div.sj')
i = 1
streams.each do |stream|
if stream.text != ''
puts i.to_s+') '+stream.search('span.kh').text+' shared:'
puts stream.search('div.eo').text
else
puts i.to_s+') '+'Video/photos...'
end
puts ''
i+=1
end
puts "=========================================================================\n"
end
rescue SocketError
puts 'Error in internet connection'
rescue NoMethodError
puts 'Invalid username or password or circle'
rescue Interrupt
puts "\n========================================================================="
puts "\nQuiting...."
end

php needed
http://www.lastcraft.com/browser_documentation.php
This is something equivalent to mechanize for php .. please read documentation. sorry I have not used this with php. try this
Thank you
Pretty insightful. Thanks!
My blog:
DSL Anbieter dslvergleichdsl.com