Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple XML Parse - Taking forever

Featured Replies

Hey,

 

Pretty simple problem, but not sure what it is.

 

I am pulling a number from a database, and then using a while loop to go through each row 1 by 1.

 

Basically these numbers can be used with the Steam xml, and I want to grab the customURL for the steamID64.

 

Heres an example:

$number = 76561197970745785

 

Thats an example number I grab (so 1 row).

 

Then, I use:

 

$xml = simplexml_load_file("http://steamcommunity.com/profiles/$number/?xml=1")

 

So it goes to this link:

http://steamcommunity.com/profiles/76561197970745785/?xml=1

 

On there I want to get the customURL, pretty simple:

 

$customURL = $xml->customURL;

echo $customURL . "<br />";

 

So thats basically going around in a while loop with the mysql_fetch_assoc function.

 

However...

 

There is about 30-40 numbers that I am querying, and it takes like 60 seconds for the page to load. It all works when it does, but thats taking way too long. I did a timer on each loop and its like 2 seconds per user to get the customURL.

 

Can anyone tell me if there is a way to make this code more efficiant or something? Or any alternatives to grabbing the data like that and using it.

 

Thanks :)

  • Author

Well I think, in my head, to solve this I would have to load the data and store it in my own xml file and use that data. if it wants to be refreshed i would have to click a button that runs a page again and overwrites that file.

 

Not sure though :/

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.