Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

automatic import of links XML files

Quote Reply
automatic import of links XML files
I have a friend using a link manager (not LSQL).

So each time a link is validated in his system he send to me a XML file via FTP (in the following folder -http://www.mysite.com/xml/lsql/)

So I have now many XML files in this folder

01.xml
02.xml
03.xml
.
.
.
NN.xml
(NN is the Link_ID in his own database)


Each XML file has the following structure (sample for the LINK_ID 45)

<LINK>
<ID>45</ID>
<DATEADD>YYYY-MM-DD</DATEADD>
<URL>http://www.thewebsiteurl.com</URL>
<TITLE>The title of the website 45</TITLE>
<DESCRIPTION>The description of the Website 45 The description of the Website 45 The description of the Website 45</DESCRIPTION>
<LANGUAGE>EN</LANGUAGE>
<CATEGORIES>
<CAT id="12" Name="Full Name of the category 12" />
<CAT id="25" Name="Full Name of the category 25" />
</CATEGORIES>
<SUBMITER>
<EMAIL>xxxx@xxxx.com</EMAIL>
<NAME>Firstname Lastname</NAME>
</SUBMITER>
</LINK>

I would like to set up a cron job to import these XML files automatically in my Links Database.

Is there a way to do it easily ? (checking if the link is note already in the database, then importing it and updating all the concerning tables and so on...)

Txs
FMP
Quote Reply
Re: [fmp] automatic import of links XML files In reply to
Hi FMP,

Did you solved your problem already? I have the same problem...


Thanks,
Ron
Quote Reply
Re: [sahertianr] automatic import of links XML files In reply to
hi

No I don'tUnsure

If anyone have...
Quote Reply
Re: [fmp] automatic import of links XML files In reply to
Had a similar problem, used Vedit to replace all the xml code with pipes and then imported them that was.. maybe that's an option??

</not a clue>
Quote Reply
Re: [fmp] automatic import of links XML files In reply to
Its totally possible ... just not that "generic" (i.e you can't have one plugin, that will import all XML entries with ease). The main reason for this, is simply the fact that peoples XML feed's will obviously differ (i.e one may have 3 levels deep, whilst others may only go 1 or 2 levels deep).

Before anyone sends any emails/PM's to me ... I can't take on any more work at the moment I'm afraid Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] automatic import of links XML files In reply to
Andy

If all XML files are similar, I am sure there would be a way to use one of your plugins without MUCH customization...!!
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News


Quote Reply
Re: [nakulgoyal] automatic import of links XML files In reply to
If the XML file could be exported to either comma, tab, or pipe, delimited files (i.e Title|URL|Description|Category, etc) ... then it would be possible to do it with my Data_Import plugin .... BUT, this wouldn't be much help if the data is in XML format :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] automatic import of links XML files In reply to
yes, that's what I thought, makes sense. Thanks.
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News


Quote Reply
Re: [fmp] automatic import of links XML files In reply to
In Reply To:
I have a friend using a link manager (not LSQL).
So each time a link is validated in his system he send to me a XML file via FTP (in the following folder -http://www.mysite.com/xml/lsql/)
So I have now many XML files in this folder

01.xml
02.xml
03.xml
.
.
.
NN.xml
(NN is the Link_ID in his own database)

Each XML file has the following structure (sample for the LINK_ID 45)

<LINK>
<ID>45</ID>
<DATEADD>YYYY-MM-DD</DATEADD>
<URL>http://www.thewebsiteurl.com</URL>
<TITLE>The title of the website 45</TITLE>
<DESCRIPTION>The description of the Website 45 The description of the Website 45 The description of the Website 45</DESCRIPTION>
<LANGUAGE>EN</LANGUAGE>
<CATEGORIES>
<CAT id="12" Name="Full Name of the category 12" />
<CAT id="25" Name="Full Name of the category 25" />
</CATEGORIES>
<SUBMITER>
<EMAIL>xxxx@xxxx.com</EMAIL>
<NAME>Firstname Lastname</NAME>
</SUBMITER>
</LINK>

I would like to set up a cron job to import these XML files automatically in my Links Database.
Is there a way to do it easily ? (checking if the link is note already in the database, then importing it and updating all the concerning tables and so on...)


Hi, I am still looking for this kind of import script... does anyone has done it since my last post ?

How much would it be to do it ?

Creating a cron that :
1) look in the file where the XML files are
2) take the new files
3) import the content of this file in the database
4) delete the XML file

(maybe there are other steps like verifying if the ling already exist in the database, if yes it the script doesn't import that link...)

options : possibility to import other feed that are not formated in the same way (not the same file name, files not present not the same directory, different tags names...)

Regards
FMP
Quote Reply
Re: [fmp] automatic import of links XML files In reply to
Might take a look at:
http://www.gossamer-threads.com/...;;page=unread#unread

I use it to import .xml, but it's only manual, maybe you can modify it...

</not a clue>
Quote Reply
Re: [Dinky] automatic import of links XML files In reply to
I run a download script that converts the xml >> csv and then an import script that imports the data into the database.

PM if you want a look at these scripts.

Andy also wrote me a customised import script that did the whole job in one.