Taking in XML Data
Posted: 16 May 2008 05:08 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  33
Joined  2006-12-02

I’m considering adding some job postings to my site. I can get a XML request (URL) that returns something like the code below. How would I parse this info...would the magpie plugin be of some help?

<?xml version="1.0" encoding="UTF-8" ?>
<response>
    <
query>java</query>
    <
location>austin, tx</location>
    <
dupefilter>true</dupefilter>
    <
highlight>false</highlight>
    <
totalresults>547</totalresults>
    <
start>1</start>
    <
end>10</end>
    <
results>
        <
result>
            <
jobtitle>Java Developer</jobtitle>
            <
company>XYZ Corp.</company>
            <
city>Austin</city>
            <
state>TX</state>
            <
country>US</country>
            <
source>Dice</source>
            <
date>Tue, 13 May 2008 17:04:42 GMT</date>
            <
snippet>looking for an object-oriented Java Developer... Java Servlets, HTML, JavaScript,
            
AJAX, Struts, Struts2, JSF) desirable. Familiarity with Tomcat and the Java...</snippet>
            <
url>http://www.xyz.com/viewjob?jk=12345&xyzpubnum=11111111111111</url>
            
<onmousedown>indeed_clk(this,'0000');</onmousedown>
            <
latitude>30.27127</latitude>
            <
longitude>-97.74103</longitude>
            <
jobkey>12345</jobkey>
        </
result>
        ...
    </
results>
</
response>

Profile
 
 
Posted: 16 May 2008 11:05 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  11033
Joined  2004-05-15

Obviously, you need to parse this XML. You can either use pure PHP for that, or make use of the built-in XML Parser class. Either way, it will take a bit of development on your part to process.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.
No PM’s, please—use regular mail.

Profile
 
 
Posted: 17 May 2008 12:11 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  33
Joined  2006-12-02

Found a plugin that looks like it’ll work pretty well.

XMLGrab Plugin

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 58059 Total Logged-in Users: 30
Total Topics: 68028 Total Anonymous Users: 22
Total Replies: 366428 Total Guests: 443
Total Posts: 434456    
Members ( View Memberlist )