inserting records coming from a rss feed into a cms builder

5 posts by 3 authors in: Forums > CMS Builder
Last Post: September 8, 2010   (RSS)

By moh3 - September 3, 2010

hello to all

i have a question about inserting records coming from
a rss feed into a cms builder section, the idea is that i have created a plugin that utilize a function when you enter the section which i called area it calls the function which in return
call cURL and gets some info from the rss channel
and in return inserts this info into the db table

but i have a problem in duplicate records how would i make
my db tables unquie so that any duplicates will refused

i also need to control the publishing of these records
so that only records i approve gets published

awaiting your help please

Re: [moh3] inserting records coming from a rss feed into a cms builder

By Chris - September 6, 2010

Hi moh3,

You can solve the approval problem with a "hidden" field. See [url http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html]the documentation on special fields[/url] for more information.

For duplicates, that'll require a very specialized solution. If the RSS feed has any unique fields (I believe they usually do!) you can do a SELECT before each INSERT to make sure you haven't already added a record with that field value.

Another approach would be to keep track of the latest publish date for your RSS feed records and simply ignore anything from the feed that isn't newer than the newest date you've already added.

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [moh3] inserting records coming from a rss feed into a cms builder

By Toledoh - September 7, 2010

This sounds like very interesting plugin. Good luck!
Cheers,

Tim (toledoh.com.au)

Re: [chris] inserting records coming from a rss feed into a cms builder

By moh3 - September 8, 2010

thanks chris will the check for a record slow the site?
the idea is each time i enter this section i would fire a function to get new rss record from a remote site

my question is:
1- can you please maybe provide a code example on how
to only restrict this function for the admin

2- how would i create an simple form that has fields
for text and submit button were through this form i would enter a url and on submit fire my function which will get new rss records

3- what kind of query will can i use to check for records
and can i use any built db functions to that,any docs about the software would nice to extend it