Skip to:
Content
Pages
Categories
Search
Top
Bottom

Scraping an XML Feed & Adding to User Profile?

  • Hello,

    I’ve searched and searched the Net but not found an answer… also, I’m a novice when it comes to php. I work mainly as a designer and frontend coder…

    I have a World of Warcraft community site that runs on Buddypress. I want users to be able to import their WoW character(s) into their profile and (choose to) display them as part of their profile… for starters.

    I know part of the answer to my question requires me to learn more php. I’m doing so now. I also know that the WoW armory has an xml feed that one can scrape. I need to know how to scrape it and how to add that to the user’s profile as an option.

    If anyone reading this can help in any way I’d surely appreciate it.

    Eventually I want to turn this into a plugin.

    Thanks,

    DC

Viewing 2 replies - 1 through 2 (of 2 total)
  • As a very skethcy outline of the top of my head you might follow something along these lines:

    Using a custom xprofile field set in a new fieldgroup so that it didn’t appear on the main signup group ( or not as may be desired) you could have this field gather a user set url or portion of i.e if the feed url has a particular parameter to id the users WoW you could ask they supply that as a string for the custom field.

    Now you have a unique value for this user you could try using simpleXml library to fetch and parse the feed, so using probably $xml_feed = simplexml_load_file() pass in the url of the feed plus the users xprofile field string to create an object specific to that user then you would simply need to render the parts of the feed you required $xml_feed->channel->item.

    That is obviously a very patchy example, but in principle should be workable.

    Hi hnla,

    Thanks for your reply. Yes, that seems to make sense. Currently on a number of other sites like http://wow-heroes.com for example, you can enter the character name and choose the realm the character exists on from a dropdown list.

    That said, I guess the first step in my journey is to learn how to pull in data from an outside source in to the user profile? Something simple to start with… user enters their favorite song, which imports a YouTube video of the song if its available, for example.

    Thoughts?

    Thank you,

    DC

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Scraping an XML Feed & Adding to User Profile?’ is closed to new replies.
Skip to toolbar