Jump to content

Content Reader..


euroiplayer

Recommended Posts

Hello everyone,
I been trying to figure this out but haven't been able to.

Is it possible to get the content on somebody's [b]private[/b] myspace comments profile if you're one of their friends.
I am thinking it would first login to myspace, and then read the comments of that profile.

Tell me is it possible, and if so with what, php or perl..?
Link to comment
https://forums.phpfreaks.com/topic/30251-content-reader/
Share on other sites

There is soo little information on cURL, and I don't know a thing about it.

Does anybody know how to go on about this?

Is this useful in any way of what I am trying to do?
[quote]
curl -A 'ELinks/0.9.2 (textmode; Linux; 80x24)'
--trace-ascii /tmp/trace -L -b cookies.txt -c
cookies.txt -d
'email=xxxx%40gmail.com&password=xxxxx&Submit22.x=0&Submit22.y=0'
http://www.myspace.com/index.cfm?fuseaction=login.process [/quote]
Link to comment
https://forums.phpfreaks.com/topic/30251-content-reader/#findComment-139601
Share on other sites

Below is a small class I used to parse new messages, friend requests, and comments.  You should be able to use the connect method for what you're trying to do.  Once logged in you can go to any page you wish and parse the results.

[code]
<?php

define(LOGIN_URL,         'http://collect.myspace.com/index.cfm?fuseaction=login.process');
define(SESSION_URL,     'http://home.myspace.com/index.cfm?fuseaction=user');
define(DESTINATION_URL,           '');
define(MESSAGE_FLAG,           '<div id="indicatorMail" class="show indicator">');
define(COMMENT_FLAG,           '<div id="indicatorComments" class="show indicator">');
define(IMAGE_COMMENT_FLAG,  '<div id="indicatorImageComments" class="show indicator">');
define(FRIEND_FLAG,       '<div id="indicatorFriendRequest" class="show indicator">');
define(BLOG_COMMENTS_FLAG, '<div  id="indicatorBlogComments" class="show indicator">');


class MyspaceConnection
{

var $email;
var $password;
var $curlObject;
var $postData;
var $agent;
var $collectHeader;
var $homeHeader;
var $addHeader;
var $htmlOut;

    function MyspaceConnection($email, $password)
    {
    $this->email = $email;
    $this->password     = $password;
    $this->postData       = "email={$this->email}&password={$this->password}";
    $this->curlObject       = curl_init();
    $this->agent = $_SERVER["HTTP_USER_AGENT"];
    $this->collectHeader     = array("Host: collect.myspace.com", "Content-Type: application/x-www-form-urlencoded", "Content-Length: " . strlen($this->postData));
    $this->homeHeader   = array("Host: home.myspace.com");
    $this->addHeader     = array("Host: collect.myspace.com");
    }
   
    function connect()
    {
    curl_setopt($this->curlObject, CURLOPT_URL, LOGIN_URL);
    curl_setopt($this->curlObject, CURLOPT_HEADER, 1);
    curl_setopt($this->curlObject, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($this->curlObject, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($this->curlObject, CURLOPT_COOKIEJAR, 'cookie.txt');
    curl_setopt($this->curlObject, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($this->curlObject, CURLOPT_HTTPHEADER, $this->collectHeader);
    curl_setopt($this->curlObject, CURLOPT_POST, 1);
    curl_setopt($this->curlObject, CURLOPT_USERAGENT, $this->agent);
    curl_setopt($this->curlObject, CURLOPT_POSTFIELDS, $this->postData);
    $collectOut = curl_exec($this->curlObject);

    curl_setopt($this->curlObject, CURLOPT_URL, SESSION_URL);
    curl_setopt($this->curlObject, CURLOPT_HEADER, 1);
    curl_setopt($this->curlObject, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($this->curlObject, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->curlObject, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($this->curlObject, CURLOPT_HTTPHEADER, $this->homeHeader);
    curl_setopt($this->curlObject, CURLOPT_USERAGENT, $this->agent);
    $this->htmlOut = curl_exec($this->curlObject);
    $homeOut = curl_exec($this->curlObject);

    curl_setopt($this->curlObject, CURLOPT_URL, DESTINATION_URL);
    curl_setopt($this->curlObject, CURLOPT_HEADER, 1);
    curl_setopt($this->curlObject, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($this->curlObject, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->curlObject, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($this->curlObject, CURLOPT_HTTPHEADER, $this->addHeader);
    curl_setopt($this->curlObject, CURLOPT_USERAGENT, $this->agent);
    $data['add'] = curl_exec($this->curlObject);
   
    $file = fopen("cookie.txt", "w+");
    fclose($file);
   
    return true;
    }
   
    function disconnect()
    {
    curl_close($this->curlObject);
    }
   
    function hasNewMessages()
    {
    return (strstr($this->htmlOut, MESSAGE_FLAG) !== false);
    }
   
    function hasNewComments()
    {
    return (strstr($this->htmlOut, COMMENT_FLAG) !== false);
    }
   
    function hasNewImageComments()
    {
    return (strstr($this->htmlOut, IMAGE_COMMENT_FLAG) !== false);
    }
   
    function hasNewFriendRequests()
    {
    return (strstr($this->htmlOut, FRIEND_REQUEST_FLAG) !== false);
    }         
   
    function getHtml()
    {
    return $this->htmlOut;
    }
}
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/30251-content-reader/#findComment-139646
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.