Jump to content

input url output parced data from page source


tobykw13

Recommended Posts

Ok so I have multiple questions... I guess a series of questions to get me to the final product that I'm looking for. I am very new to php, but have done some reading on the basics on what I believe I need to accomplish. So let me just put it all out there and hopefully someone will understand what Im looking for and help me out :)

 

I have a custom myspace design site that I am working on and I need to implement a feature that I have seen on other myspace layout sites. In a nutshell, I need a form where you input a myspace url and when you submit the url it retrieves all the data from the page's source (screen scraping?), then retrieve a specified attribute out of this data (parsing?) and then implement that attribute into multiple areas of a specified html document. Im not sure if this makes any sense so I will be even more specific and give an example of what I want to accomplish:

 

I input http://www.myspace.com/isabellebanham into a form. When submitted, the page source is retrieved. in the page source is a section that looks as follows:

 

MySpace.ClientContext = {"UserId":257367900,"DisplayFriendId":13287930,"IsLoggedIn":true};

 

I need to extract the number 13287930 that follows "DisplayFriendId": (i believe this is done with parsing the data?) and then finally take that number and insert it into new urls:

 

http://mail.myspace.com/index.cfm?fuseaction=mail.message&friendID=INSERT NUMBER HERE

 

http://chat.myspace.com/index.cfm?fuseaction=messenger&strDestinationUserID=INSERT NUMBER HERE&sendType=0

 

So all in all you input a myspace url and the output shows a number of urls with the extracted number implemented into it

 

an exact example of this whole process can be found at: http://www.bbzspace.com/overlay/link.php

 

as I said, I am very new to php so I am having a lot of difficulty figuring this out, but it seems very possible. Anyone that can help I will love forever! lol If this is confusing just ask me and ill try to explain anything you aren't understanding. Thanks in advance!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.