Anonymous

Topic: XML import in to Jobberbase MySql database tool

Another question for you guys - I work in the job board industry and know how important job content is to get a decent amount of traffic to the site to make it become a valuable resource to advertisers/job seekers alike.

- its a bit of a catch 22 no content = no jobseekers = no advertisers

So finding the content is a little tough and you have to get on the phone to companies/recruitment companies to populate the site with valuable job data and all for free until. There comes a point where applications numbers from the content make your site a valuable resource to recruiters/employers and they will start to part with their money and you can make a little money from your hard work...

Ok so my point... most recruitment system (ATS/CRM) have the ability to export their job data in an XML file. This is the data you so badly need to get your job board started and gaining traction - to do this you need to be able to import the XML file in to you Jobberbase database.

Does anyone know of a useful tool to map/script an XML file in to the Jobberbase database or have any resources on this topic?

I welcome your comments.

Cheers

Anonymous

Re: XML import in to Jobberbase MySql database tool

You could use an excel sheet to save data in an XML format and then import the same to your MySQL.

digitalvoyager

Re: XML import in to Jobberbase MySql database tool

This is an excellent idea. It would be great to have this function if you want to display jobs from an API. like: http://www.modul1.se/modul1/templates/J … __668.aspx

Is there an easy way to do this? Excel sheet seems a bit unpractical.
Thanks

mattcody

Re: XML import in to Jobberbase MySql database tool

This feature would indeed be very useful.

In the UK, there are multi-job board posting tools - such as idibu (www.idibu.co.uk) and Broadbean (www.broadbean.com).

It would be a huge advantage being able to accept imports of jobs from these respective web sites.

Generally, these posting tools send out their updates either at scheduled periods, or constantly in real-time. I don't know whether that would make a difference to how these feeds could be processed.

For example, if the posting tool exported a XML/CSV file - could this somehow be FTPd to a Jobberbase import folder, with a CRON job then running a daily/hourly action to add the latest file contents to the database?

I'm no PHP expert though, so don't know how to do this.

Does anyone out there have any advice about how this could be achieved? Or are there plans to have this integrated in to the next release of Jobberbase?

Thanks in advance for your help,

Matt

SteveSPI

Re: XML import in to Jobberbase MySql database tool

I dont know how you would actually do this directly through Jobberbase, but you can certainly do it through php and setup a cron job to run the process.

Code:

<?php
/* database connection starts ... */

$host = "localhost";
$username = "root";
$password = "mypass";
$database = "mydb";

$con = mysql_connect($host,$username,$password);
mysql_select_db($database, $con);

/* database connection ends ... */


######### reading the data from xml file ######
$xml = simplexml_load_file("data.xml");

foreach($xml->children() as $child)
{ 
$allData[] = $child;
}


foreach($allData as $key=>$value)
{
$name = $allData[$key]->name;
$age = $allData[$key]->age;

$title = explode(",",$allData[$key]->title);
$JobTitle = $title[0];
$Joblocation = $title[1];

//print $name."<BR>".$age."<BR>".$JobTitle."<BR>".$Joblocation."<BR><BR>";
$sql = "INSERT INTO tbl_test (name,age,jobtitle,joblocation) VALUES('".$name."','".$age."','".$JobTitle."','".$Joblocation."')";

print $sql."<br><br><br>";
if(mysql_query($sql))
{
// print "Data Inserted Successfully";

}
else
{
// print "Data could not be Inserted Successfully<br><br>";

}


}
?>
##################

You would need to define the original xml feed and then call it with this script. I wrote this script many moons ago, so unsure if it will stlil work. This code splits the title cell, as it had an "," seperating the location which i needed to be in two fields i.e. the xml feed read Crawley, West Sussex. Where i needed Crawley and West Sussex in two fields on the database.

I hope this helps someone.

SpeedyJob.co.uk

mattcody

Re: XML import in to Jobberbase MySql database tool

Thanks Steve.

This looks interesting.

I guess the tables and the fields in the script you have posted will have to be changed to match up with the Jobberbaser details, but it all looks like it could work ok.

I'll have a go at implementing it in to my draft Jobberbase site and re-post the outcome (or problems I encounter!).

Cheers,

Matt

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Yeah the tables would need to be updated and you would need to define what the items in the xml feed are. If you get stuck, just let me know.

SpeedyJob.co.uk

redjumpsuit

Re: XML import in to Jobberbase MySql database tool

smartest way to do this is to use SimplePie. check out

http://freejoblistings.ca/hospitality/

it grabs data from an RSS feed and imports it back to the website. i worked together with the site owner to add this functionality in that website.

50% Off on Employer and Jobseeker Add-Ons for jB 1.8! ~ Looking for jobberBase hosting? For US$3.45/month  get free domain, unlimited sites, web space etc.

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Sorry to sound like a simple dimple, but how?? Does it pull the information and put it into the database or is it just a read and displays on the jobberbase site somehow. Sorry, just been looking up on the website and couldnt figure out how you would do it.

SpeedyJob.co.uk

mattcody

Re: XML import in to Jobberbase MySql database tool

I have further questions about this...

- if SimpliePie can just import xml feeds in to the Jobberbase database, how is this scheduled?
- and would it also be potentially possible to important a number of different feeds?

Thanks

Last edited by mattcody (2009-06-17 16:06:51)

redjumpsuit

Re: XML import in to Jobberbase MySql database tool

hi, sorry if the info is incomplete. you parse the xml feed via SimplePie but you need PHP hacking to get the data over to your jobs table, filter duplicate feeds, format and possibly set-up a cron job. SimplePie is used just to ensure that whatever feed you want to grab can be handled/parsed properly.

50% Off on Employer and Jobseeker Add-Ons for jB 1.8! ~ Looking for jobberBase hosting? For US$3.45/month  get free domain, unlimited sites, web space etc.

SteveSPI

Re: XML import in to Jobberbase MySql database tool

ok, i think i may have worked out how to use Simple Pie to do the xml upload automatically. Ill have a proper test over the weekend and post up a tutorial on how to use it...

SpeedyJob.co.uk

SteveSPI

Re: XML import in to Jobberbase MySql database tool

oh, if anyone has an XML feed they want me to right it for. Then simply PM me and ill custom make it to the script. Also be handy, as i have a limited number of xml feeds to test this on. So id need to know it works for the masses and not just me : - )

SpeedyJob.co.uk

lxer

Re: XML import in to Jobberbase MySql database tool

SteveSPI wrote:

ok, i think i may have worked out how to use Simple Pie to do the xml upload automatically. Ill have a proper test over the weekend and post up a tutorial on how to use it...

could you show me how it is done?
(i'll do some testing/debugging if needed)

sdf99002

Re: XML import in to Jobberbase MySql database tool

@SteveSPI - are you still working on this, need XML feeds?

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Hi, I have been working on this tonight and pretty much have it up and running. The other problem which arises, is that some feeds contain different information and its just a matter of figuring out how to capture all the correct data from the feed. Currently it Picks up the Title, Description and URL. I have some XML feeds which contain loads of information, like email address, locations, salary ranges etc. So i need to work out how to get the script to be adaptable for each type of feed.

SpeedyJob.co.uk

chrisdegrote

Re: XML import in to Jobberbase MySql database tool

Hey Steve

What's your status on making the XML feed working properly with Jobberbase? I would love to know what you've got to do to make it working. It would be a great (efficient) option for job posters.

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Hello All,

Apologies for the lack of updates on this. I have had to move away from SmiplePie, as it simply cannot handle XML Feeds. Its fantastic for RSS & Atom. But cannot deal with the varied types of XML feeds. No Fear tho, i have worked out another solution. Which requires a piece from MagicPharse, but unfortunately this cost £50 for the license. I aquired a copy for myself, but there is no resell writes allowed on it. Im looking for a free version, as i understand that £50 is quite a lot of money for it. Although I have emailed the developers of MagicScript to see if they can do me a group resellable licence and say charge £10 for the script to cover the licence if enough people would be interest. But they have yet to get back to me.

SpeedyJob.co.uk

chrisdegrote

Re: XML import in to Jobberbase MySql database tool

Hey Steve thanx for your fast reply.

It's to bad there's not a opensource project. But what do you've got to do to integrate it on a jobberbase site and what do you have to edit in jobberbase or is it something in the MySQL? I see with google a lot of posts/tutorials http://www.kirupa.com/web/xml_php_parse_beginner.htm on a free version XML/PHP parser. what's the advantage of using a paid program like Magicparse? Is it that much better?

uniq

Re: XML import in to Jobberbase MySql database tool

hi steve, did u have a look at magpierss? that should be able to parse quite well - have a look at how pligg implemented it...

Want a jobberBase feature badly - but can't program it?
Let's pool together with a script bounty -> contact me through PM
host your jobberBase install for free!

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Cool, ill have a look tonight

SpeedyJob.co.uk

randallu

Re: XML import in to Jobberbase MySql database tool

Is there a tutorial in sight for us less talented folk? If not I may have to hire someone, would be great to have this on my site wink

SteveSPI

Re: XML import in to Jobberbase MySql database tool

Ok progress so far, is I managed to pass a file with 25,000 records in 2mins 32seconds. Which actually to be fair is pretty quick. The problem I have is making it so its easy for people to deploy for several feeds. Writing it for one feed is actually pretty easy. Im going to go at it tonight and hopefully have something that people can download and test in the next day or so.

SpeedyJob.co.uk

chrisdegrote

Re: XML import in to Jobberbase MySql database tool

Hey SteveSPI

That would be great looking forward to it! wink

Tokyoj

Re: XML import in to Jobberbase MySql database tool

25K job in 2.32 min? ....gee...you mean I have to wait the extra 32 seconds...that's more than enough time to get a beer from the kitchen and get back to the PC smile

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)