Jump to content

Am I Going About This The Right Way Or Is There A Better Way


far2slow

Recommended Posts

we have a small fourm will only ever be 100 members

 

each member has a xbox gamer id in there profile

what i want to do is call each gamer id and pass it to xbox live and fetch there online status

but as this will take some time to do

 

is it best i run a script that will do the scraping in the background let it run every hour and send the the result into the database so it can be called

 

or am i going about this all the wrong way ?

Edited by far2slow
Link to comment
Share on other sites

I would check how long it takes to get the information from Xbox Live. Based on what I know you can only check the online status of your friends. If these people are all your friends on Xbox Line then it would only take one scrape to get all of their online statuses. If you are going to do multiple scrapes to get the data then my answer below might change.

 

Based upon my understanding this is the process I would follow. When page loads where you want to display online status:

 

1. Script should first check if a cache file exists (e.g. xbox_online.txt).

2a. If the file does not exist then create it.

2b. If the file exists, check the time that the file was last updated.

3. If 2a was true OR if the last updated time was > the specified value (e.g. 60 minutes) then run a screen scrape and put the results into the cache file

4. Use the data in the cache file to display the online status of the users

 

Using the above process you will only get a new online status if a user visits the page and the cache data is > 60 minutes (or whatever value you set). I would not think that scraping the page would take so long that it would be an issue.

 

I suggest the cache file with the assumption that the data is only going to be used for displaying the online status. In fact, I would create the cache file already formatted as HTML code. So, you would only need to include() it int he output of the page. However, if you have other purposes for this data, then you should put it in the database.

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.