473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Re: Orkut Grabber

Hello Raja.

Where is the constructor of the class orkut ??
On Oct 24, 1:40*pm, Raja <RajaSa...@gmail.comwrote:
Hi,
* *I download the contact grabber from sourceforge.com,

Now google, yahoo mails are working fine but orkut doesn't working,
orkut page redirected towww.orkut.com/Friends.aspx.

Any one worked in contact grabber,please help to implement contact
importer.

I attached the below code and in this code, there are no constructor.

I changed name of the function grabOrku() to orkut() and i can't get
the address.

Thanks & Regards,
Rajasekar.A

Config.php

$DIR_PATH = "/home/grinfote/public_html/contactgrabber";
$CURL_PATH = "/usr/local/bin/curl"; //or "/usr/bin/curl"
$ERROR_LOGIN = "<br />Login Error...";

orkut.class

class orkut * * extends baseFunction
{
* *var $dir_path = "";
* *var $error_msg = "";
* *var $fileName ="";

* *function grabOrkut()
* *{
* * * * *require_once('./config.php');
* * * * *$this->dir_path = $DIR_PATH;
* * * * *$this->error_msg = $ERROR_LOGIN;
* *}

* *function getAddressbook($YOUR_EMAIL,$YOUR_PASSWORD)
* *{

* * * * * #the globals will be updated/used in the read_header function
* * * * * * * * global $location;
* * * * * * * * global $cookiearr;
* * * * * * * * global $ch;

* * * * * #initialize the curl session
* * * * * * * * $ch = curl_init();
* * * * * * * * curl_setopt($ch, CURLOPT_URL,"http://www.orkut.com/Home.aspx");
* * * * * * * * curl_setopt($ch, CURLOPT_REFERER, "");
* * * * * * * * curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this,
'read_header'));
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);

* * * * * #get the html from gmail.com
* * * * * * * * $html = curl_exec($ch);

* * * * * * * * $matches = array();
* * * * * * * * $actionarr = array();

* * * * * * * * $action = "https://www.google.com/accounts/ServiceLoginAuth";

* * * * * #parse the login form:
* * * * * #parse all the hidden elements of the form
* * * * * * * * preg_match_all('/<input type\="hidden" name\="([^"]+)".*?value
\="([^"]*)"[^>]*>/si', $html, $matches);
* * * * * * * * $values = $matches[2];
* * * * * * * * $params = "";

* * * * * * * * $i=0;
* * * * * * * * foreach ($matches[1] as $name)
* * * * * * * * {
* * * * * * * * * $params .= "$name=" . urlencode($values[$i]) . "&";
* * * * * * * * * ++$i;
* * * * * * * * }

* * * * * * * * $login = urlencode($YOUR_EMAIL);
* * * * * * * * $password = urlencode($YOUR_PASSWORD);

* * * * * #submit the login form:
* * * * * * * * curl_setopt($ch, CURLOPT_URL,$action);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_POSTFIELDS, $params ."Email=$login&Passwd=
$password&PersistentCookie=");
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);
* * * * * * * * $html = curl_exec($ch);

* * * * * * if (preg_match('/url=([^"]*)/', $html, $actionarr)!=0)
* * * * * * * * {
* * * * * * * * * * * * $location = $actionarr[1];
* * * * * * * * }
* * * * * * * * else
* * * * * * * * {
* * * * * * * * * * * * return 1;
* * * * * * * * }

* * * * * * * * $location = str_replace("&quot;", '', $location);
* * * * * * * * $location = str_replace("&amp;", '&', $location);
* * * * * * * * $location = trim ($location,"'\"");
* * * * * * * * $fp = fopen("cookie.txt", "w+");
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_URL, $location);
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
* * * * * * * * $h = curl_exec($ch);
* * * * * * * * $ork_cookie = explode("orkut_state=",$h);
* * * * * * * * $orkut_cookie = split(";",$ork_cookie[1]);
* * * * * * * * $orkut_state = "orkut_state=".$orkut_cookie[0];

* * * * * * * * $handle = fopen($filename, "w+");
* * * * * * * * fwrite($handle,"");

* * * * * * * * $location = "http://www.orkut.com/Friends.aspx";
* * * * * * * * #follow the location specified after login
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_URL, "$location");
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
* * * * * * * * curl_setopt($ch, CURLOPT_COOKIE,$orkut_state);

* * * * * * * * $html = curl_exec($ch);

* * * * * * * * $regexp = "showing <B>[^<]*<\/bof <b>(.*?)<\/b>";
* * * * * * * * preg_match_all("/$regexp/s", $html, $matches);
* * * * * * * * $noOfContacts = $matches[1][0];

* * * * * * * * $noOfPages = ceil(($noOfContacts / 20));//find out the no of pages
of friends

* * * * * * * * for ($i = 1 ; $i <= $noOfPages ; $i++)
* * * * * * * * {

* * * * * * * * * * * * $friendsPage = "http://www.orkut.com/Friends.aspx?show=all&pno=$i";
* * * * * * * * * * * * $html = "";

* * * * * * * * * * * * $ch6 = "";
* * * * * * * * * * * * $ch6 = curl_init();
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_URL, $friendsPage);

* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_REFERER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_RETURNTRANSFER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_HEADER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_COOKIE, *$orkut_state);

* * * * * * * * * * * * $html = curl_exec($ch6);

* * * * * * * * * * * * echo $html;
* * * * * * * * * * * * exit();

* * * * * * * * * * * * $html = str_replace("\n","",$html);
* * * * * * * * * * * * $friendsArray = array(); *//this is the array for friends listing.
We initialize it to NULL everytime
* * * * * * * * * * * * $friendsArray = explode('<h3 class="smller">',$html);
* * * * * * * * * * * * $firstElement = array_shift($friendsArray); *//arrayshif used for
remove the upper part of the array in the friend list

* * * * * * * * * * * * foreach($friendsArray as $key=>$value)
* * * * * * * * * * * * {
* * * * * * * * * * * * * * * * $arr = explode('</h3>', $value);

* * * * * * * * * * * * * * * * $username= strip_tags($arr[0]);//striptags used for remove the a
href in the name

* * * * * * * * * * * * * * * * $emailE = explode('<div class="nor">', $value);
* * * * * * * * * * * * * * * * $emailE = explode('<br>', $emailE[1]);

* * * * * * * * * * * * * * * * $emails = $emailE[0];
* * * * * * * * * * * * * * * * $domain = strstr($emails,"@");

* * * * * * * * * * * * * * * * if(isset($domain) && !empty($domain))
* * * * * * * * * * * * * * * * {
* * * * * * * * * * * * * * * * * * * * $result['name'][]=$username;
* * * * * * * * * * * * * * $result['email'][]=$emails;
* * * * * * * * * * * * * * * * }
* * * * * * * * * * * * }
* * * * * * * * }
* * * * * * * * return *$result;
* * * * }

}

Oct 24 '08 #1
1 2535
On Oct 24, 2:33*am, Suhas Dhoke <suhasdh...@gmail.comwrote:
Hello Raja.

Where is the constructor of the class orkut ??

On Oct 24, 1:40*pm, Raja <RajaSa...@gmail.comwrote:
Hi,
* *I download the contactgrabberfrom sourceforge.com,
Now google, yahoo mails are working fine but orkut doesn't working,
orkut page redirected towww.orkut.com/Friends.aspx.
Any one worked in contactgrabber,please help to implement contact
importer.
I attached the below code and in this code, there are no constructor.
I changed name of the function grabOrku() to orkut() and i can't get
the address.
Thanks & Regards,
Rajasekar.A
Config.php
$DIR_PATH = "/home/grinfote/public_html/contactgrabber";
$CURL_PATH = "/usr/local/bin/curl"; //or "/usr/bin/curl"
$ERROR_LOGIN = "<br />Login Error...";
orkut.class
class orkut * * extends baseFunction
{
* *var $dir_path = "";
* *var $error_msg = "";
* *var $fileName ="";
* *function grabOrkut()
* *{
* * * * *require_once('./config.php');
* * * * *$this->dir_path = $DIR_PATH;
* * * * *$this->error_msg = $ERROR_LOGIN;
* *}
* *function getAddressbook($YOUR_EMAIL,$YOUR_PASSWORD)
* *{
* * * * * #the globals will be updated/used in the read_header function
* * * * * * * * global $location;
* * * * * * * * global $cookiearr;
* * * * * * * * global $ch;
* * * * * #initialize the curl session
* * * * * * * * $ch = curl_init();
* * * * * * * * curl_setopt($ch, CURLOPT_URL,"http://www.orkut.com/Home.aspx");
* * * * * * * * curl_setopt($ch, CURLOPT_REFERER, "");
* * * * * * * * curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this,
'read_header'));
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);
* * * * * #get the html from gmail.com
* * * * * * * * $html = curl_exec($ch);
* * * * * * * * $matches = array();
* * * * * * * * $actionarr = array();
* * * * * * * * $action = "https://www.google.com/accounts/ServiceLoginAuth";
* * * * * #parse the login form:
* * * * * #parse all the hidden elements of the form
* * * * * * * * preg_match_all('/<input type\="hidden" name\="([^"]+)".*?value
\="([^"]*)"[^>]*>/si', $html, $matches);
* * * * * * * * $values = $matches[2];
* * * * * * * * $params = "";
* * * * * * * * $i=0;
* * * * * * * * foreach ($matches[1] as $name)
* * * * * * * * {
* * * * * * * * * $params .= "$name=" . urlencode($values[$i]) . "&";
* * * * * * * * * ++$i;
* * * * * * * * }
* * * * * * * * $login = urlencode($YOUR_EMAIL);
* * * * * * * * $password = urlencode($YOUR_PASSWORD);
* * * * * #submit the login form:
* * * * * * * * curl_setopt($ch, CURLOPT_URL,$action);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_POSTFIELDS, $params ."Email=$login&Passwd=
$password&PersistentCookie=");
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);
* * * * * * * * $html = curl_exec($ch);
* * * * * * if (preg_match('/url=([^"]*)/', $html, $actionarr)!=0)
* * * * * * * * {
* * * * * * * * * * * * $location = $actionarr[1];
* * * * * * * * }
* * * * * * * * else
* * * * * * * * {
* * * * * * * * * * * * return 1;
* * * * * * * * }
* * * * * * * * $location = str_replace("&quot;", '',$location);
* * * * * * * * $location = str_replace("&amp;", '&',$location);
* * * * * * * * $location = trim ($location,"'\"");
* * * * * * * * $fp = fopen("cookie.txt", "w+");
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_URL, $location);
* * * * * * * * curl_setopt($ch, CURLOPT_HEADER, 1);
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
* * * * * * * * $h = curl_exec($ch);
* * * * * * * * $ork_cookie = explode("orkut_state=",$h);
* * * * * * * * $orkut_cookie = split(";",$ork_cookie[1]);
* * * * * * * * $orkut_state = "orkut_state=".$orkut_cookie[0];
* * * * * * * * $handle = fopen($filename, "w+");
* * * * * * * * fwrite($handle,"");
* * * * * * * * $location = "http://www.orkut.com/Friends.aspx";
* * * * * * * * #follow the location specified after login
* * * * * * * * curl_setopt($ch, CURLOPT_POST, 0);
* * * * * * * * curl_setopt($ch, CURLOPT_URL, "$location");
* * * * * * * * curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
* * * * * * * * curl_setopt($ch, CURLOPT_COOKIE,$orkut_state);
* * * * * * * * $html = curl_exec($ch);
* * * * * * * * $regexp = "showing <B>[^<]*<\/bof <b>(.*?)<\/b>";
* * * * * * * * preg_match_all("/$regexp/s", $html, $matches);
* * * * * * * * $noOfContacts = $matches[1][0];
* * * * * * * * $noOfPages = ceil(($noOfContacts / 20));//find out the no of pages
of friends
* * * * * * * * for ($i = 1 ; $i <= $noOfPages ; $i++)
* * * * * * * * {
* * * * * * * * * * * * $friendsPage = "http://www.orkut.com/Friends.aspx?show=all&pno=$i";
* * * * * * * * * * * * $html = "";
* * * * * * * * * * * * $ch6 = "";
* * * * * * * * * * * * $ch6 = curl_init();
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_URL, $friendsPage);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_REFERER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_RETURNTRANSFER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_HEADER, true);
* * * * * * * * * * * * curl_setopt($ch6, CURLOPT_COOKIE, *$orkut_state);
* * * * * * * * * * * * $html = curl_exec($ch6);
* * * * * * * * * * * * echo $html;
* * * * * * * * * * * * exit();
* * * * * * * * * * * * $html = str_replace("\n","",$html);
* * * * * * * * * * * * $friendsArray = array(); *//this is the array for friends listing.
We initialize it to NULL everytime
* * * * * * * * * * * * $friendsArray = explode('<h3 class="smller">',$html);
* * * * * * * * * * * * $firstElement = array_shift($friendsArray); *//arrayshif used for
remove the upper part of the array in the friend list
* * * * * * * * * * * * foreach($friendsArray as $key=>$value)
* * * * * * * * * * * * {
* * * * * * * * * * * * * * * * $arr = explode('</h3>', $value);
* * * * * * * * * * * * * * * * $username = strip_tags($arr[0]);//striptags used for remove the a
href in the name
* * * * * * * * * * * * * * * * $emailE= explode('<div class="nor">', $value);
* * * * * * * * * * * * * * * * $emailE= explode('<br>', $emailE[1]);
* * * * * * * * * * * * * * * * $emails= $emailE[0];
* * * * * * * * * * * * * * * * $domain= strstr($emails,"@");
* * * * * * * * * * * * * * * * if(isset($domain) && !empty($domain))
* * * * * * * * * * * * * * * * {
* * * * * * * * * * * * * * * * * ** * $result['name'][]=$username;
* * * * * * * * * * * * * * $result['email'][]=$emails;
* * * * * * * * * * * * * * * * }
* * * * * * * * * * * * }
* * * * * * * * }
* * * * * * * * return *$result;
* * * * }
}

Hi,
I changed name of the function grabOrku() to orkut() and i
can't get
the address. I got only empty contact list.

I thing, Cookie path is not properly setting, Could you please check
the code, otherwise, I will send the full code to you.

Thanks & Regards,
Rajasekar.A.
Oct 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Blmn | last post by:
anybody knows how star buttons on gmail work? or friend-rates on orkut? they use the same technic. it should be some sort of connection between c# and javascript. any article or tips would be...
1
by: Fabiano | last post by:
Please, someone know how can i do a background postback, such as the "Friend Karma" at Orkut? Tks in adv. Fabiano
1
by: Soby | last post by:
Hi, Is there any orkut api for .net users .Plese send reply its very urgent Soby/-
4
by: hsn22 | last post by:
im trying to log into orkut so i can do some things on the page. but im having trouble logging into the orkut page. this is as far as i have come (yay!) this is the link that logs people into...
9
bajajv
by: bajajv | last post by:
Hi, I am having problem in accessing gmail and orkut. It gives The page cannot be displayed. The ssl 2.0 and ssl 3.0 are enabled. I am having xp sp2. Any idea how it can be solved? Thanks.
7
dmjpro
by: dmjpro | last post by:
Hi Experts. I m now days doing test on ORKUT JS code. I need your help experts. Now there are multiple forms in a page. But no actions are there. Now when the page is submitted then this...
1
by: kierandes | last post by:
Hi all, been toying around with the idea of a website section grabber. For example, when you go into excel and add an external data source via a website your able to select a area of text etc.. ...
10
by: jodleren | last post by:
Hi I know, that there are a lot of people having problems with orkut.com, errors like "object expected" and named objects missing. When loading the site can generate some 10 errors, and still...
1
by: prasadpanati | last post by:
Hi all, I a beginner in to asp.net and learning to use httpwebrequest. I am trying to login to orkut.com using the following code.... but unfortunatly i am unable to login to it Can some one...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.