Joomla!
http://forum.joomla.org/

RSS 2 Joomla / Mambo import script
http://forum.joomla.org/viewtopic.php?f=178&t=12029
Page 1 of 6

Author:  typera [ Thu Oct 13, 2005 8:20 am ]
Post subject:  RSS 2 Joomla / Mambo import script

Hi All,

thought I post a better commented version of the scripts posted http://forum.joomla.org/index.php?topic=6496 in this forum as its better suited to this forum.

Basically take your pick at either of these (one for Joomla other for Mambo).

This script does require some basic PHP skills but if you are happy with defaults then this is all you need to do:
1. Edit MySQL DB configuration (lines 16-19)
2. RSS feed URL or local RSS feed file location (Lines 22 or 23)
3. Email address for new feed notification (line 26)

Happy importing.

PS: If anyone is interested in making this into a component, please let me know (PM me).

Cheers,
Max

Author:  bluesaze [ Thu Oct 13, 2005 1:03 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Hello thank you I was in need of such a script I'll try it out and give you the feedback

cheers
jacob

Author:  typera [ Thu Oct 13, 2005 1:22 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

No probs at all, its quiet handy, saves some time :-)

Author:  manipul8or [ Sun Oct 16, 2005 7:28 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

When I upload the script (edited to my database ect.) I get error messages telling me rss.php does not exist. Where am I supposed to place this script ? What is the rss.php and how can I get it ? And lastly, what if I want multiple rss feeds, each article a seperate content item, and sorted by date ? Is this possible ?

Sorry bout all the question, sortof noob at this stuff, though some help would be greatly appreciated. Thankyou.

Author:  typera [ Sun Oct 16, 2005 8:49 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Your need to have RSS_XML PHP Pear library installed on the server (ie shared under php installation).

If not, just copy rss.php from the above pear ibrary to the same directory as yoru script.

Author:  typera [ Wed Oct 19, 2005 9:07 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

I have created this as a project on Joomla Sourceforge, http://developer.joomla.org/sf/sfmain/d ... uto_import

Cheers,
Max

Author:  saintman [ Wed Oct 19, 2005 2:49 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

2 typera
Some update for rss feeds that have time information in ....

Replace this line:

      $publishdate = date('Y-m-d H:i:s', strtotime($item['pubdate'])); //Convert feed article publish date to mambo publish date
$publishdate_readable =  date('d-m-Y, H:i', strtotime($item['pubdate'])); // I didnt like the standard date format, this is for email field


with these:
$publishdate = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $item['dc:date']);
$publishdate = str_replace('T', ' ', $publishdate);

$publishdate = date('Y-m-d H:i:s', strtotime($publishdate)); //Convert feed article publish date to mambo publish date
$publishdate_readable =  date('d-m-Y, H:i', strtotime($publishdate)); // I didnt like the standard date format, this is for email field


But it would be better if you make the script to decide automaticaly what time format was used in rss feed.
This change was based on rss-import.php form WordPress distributive. I'd advise you to look at this script as you may find there some intersting code to make your script more advanced :)

Author:  typera [ Wed Oct 19, 2005 3:34 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

thanks, this will make it look like the webmaster never sleeps :-)

Author:  Petterin [ Wed Oct 19, 2005 4:18 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

I got this kind of error message?

Warning: Unknown(/www/asiakkaat/XXX/public_html/XXX/rss2mambo.php): failed to open stream: Permission denied in Unknown on line 0

Warning: (null)(): Failed opening '/www/asiakkaat/XXX/public_html/XXX/rss2mambo.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0

Author:  typera [ Wed Oct 19, 2005 4:27 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Thats odd, did you make the required changes before trying to use it?

Author:  eugene33 [ Thu Oct 20, 2005 5:05 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Hello,
Very nice and so useful script ;)
Sadly I can't make it work, sorry i'm quite a noob. :-[

I followed the instructions, and made a "scripts" folder where I uploaded the RSS.php and rss2joomla.php, in which I changed the parameters.
But stil I got this message, I "googled" all night to find this WML/Parser.php but didn't find a clue on this.

Quote:
Warning: main(XML/Parser.php): failed to open stream: No such file or directory in /var/www/free.fr/a/8/crisis.communication/scripts/RSS.php on line 23

Fatal error: main(): Failed opening required 'XML/Parser.php' (include_path='/var/www/xxx/x/x/crisis.communication/include:.') in /var/www/xxx/x/x/crisis.communication/scripts/RSS.php on line 23
 


Any help would be very welcome.

Author:  typera [ Thu Oct 20, 2005 5:12 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Are you getting the same error as Petterin ?

How are you trying to run the file?

Author:  eugene33 [ Thu Oct 20, 2005 5:46 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Hi Typera,

No i don't think it's the same error as Petterin.
If I understand well the script is looking for a file called "Parser.php" in the folder "XML" I tried to find such file on the Pear & PHP web site, but I couldn't find any references to this.

So I tried to use the file 01.parse.phpt, that I renamed as Parser.php, but of course no luck at all. Then I tried to use the "domit" RSS and Parser in the folder "includes" expecting I could parse, but still can't work.
So I'n out of any option now  :-[

Too use the file I'm using http://my.web.site/script_folder/rss2joomla.php in a browser.

Author:  typera [ Thu Oct 20, 2005 6:15 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Contact your hosting support and make sure that PHP Pear libraries are accessible, I think thats where the problem is.

Author:  jkims [ Thu Oct 20, 2005 10:15 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Thanks for this great script.  I installed it and everything worked but I have a question about the output.

It will parse the rss but the problem I have is that the Intro Text or teaser is the same as what is in the main text. It doesn't put the entire article in the main text.  Do I have something set up wrong or is this how it works?  I tested it using the same rss url that was included in the script.

Author:  typera [ Fri Oct 21, 2005 6:06 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Intro text and main text both come from the same field within the RSS feed, the article description. The only difference is that intro text is limited to number of characters while main text is not.

If only RSS feeds contained full articles, unfortunately there are very few which have more than 2 lines in description.

Cheers,
Max

Author:  saintman [ Tue Oct 25, 2005 7:36 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

eugene33 wrote:
Hi Typera,

No i don't think it's the same error as Petterin.
If I understand well the script is looking for a file called "Parser.php" in the folder "XML" I tried to find such file on the Pear & PHP web site, but I couldn't find any references to this.

So I tried to use the file 01.parse.phpt, that I renamed as Parser.php, but of course no luck at all. Then I tried to use the "domit" RSS and Parser in the folder "includes" expecting I could parse, but still can't work.
So I'n out of any option now  :-[

Too use the file I'm using http://my.web.site/script_folder/rss2joomla.php in a browser.


If you have troubles with RSS.php, try this:

change this line -
require 'RSS.php';

with this -
require 'XML/RSS.php';

that worked for me...

Author:  eugene33 [ Wed Oct 26, 2005 1:00 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Thanks Saintman
Sadly I just tried it but still don't work on a subdomain from this server (http://www.free.fr) Like Typera said, it should be a prob with my FAI.
Anyway it works really fine on another server I own, and on which I have all the rights.

Author:  typera [ Wed Oct 26, 2005 1:40 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

I have seen this with some hosting places where the apache/php config has path restrictions in place, and the list of excepted locations does not include the global pear location. Best get in touch with your hosting service provider, its a 2 min fix.

Author:  eugene33 [ Wed Oct 26, 2005 2:00 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Thanks Typera
I have been in touch with them, but currently they can't or don't want, to do anything.
Well it's not a great deal, I plan to move to a real hosting service when the site will be fully finished.

Anyway, You realized the tool I was dreaming of and it work just fine on my other web site and for this THANKS  :D :D :D

Author:  typera [ Wed Oct 26, 2005 2:41 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

hehe, no probs.

Watch this space, going to make this into a component so its easier to add/remove feeds, etc  ;)

Author:  eugene33 [ Wed Oct 26, 2005 3:14 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

;D ;D Great  :-*

If you were a women I would certainly ask you to marry me.
If you need some french translation for the component, I'm you man, I won't be able to help for the coding part but for translation I could

By the way, it would be very very very...nice if you could include the RSS Geolocation in your component
Just have a look to this:
WorldKit
http://brainoff.com/worldkit/doc/
http://brainoff.com/worldkit/

Author:  typera [ Wed Oct 26, 2005 3:23 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

No probs, this script really only parses supplied RSS feeds so if that info is not in it, we cant put that in. On the other hand parsing that info (if its already there) wont be too hard, can even be done with the current script with some tweaks.

Author:  akblackwel [ Thu Oct 27, 2005 2:23 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Question about the rss2mambo script. In my mysql logs, I'm only getting the database user logging into the database, but nothings being added. When I do an echo $rss_feed, the only output I'm getting is "Object" on the page. Is that what I sould be seeing?

Thanks in advance.

Kevin

Author:  Sicarii [ Thu Oct 27, 2005 9:53 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Hi typera,
Is this going to be changed into a component at all?? So the direct mysql query's can be changed to use joomla's
built-in database api. Also,cant you include the PEAR and rss_xml with the script like some other components do?
Don't get me wrong,I'm not complaining ;) I've been after something like this for a looooonnnggg time.
Cheers
Aron

Author:  typera [ Fri Oct 28, 2005 5:39 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Yes thats the idea to make it into a component, watch this space.

Author:  Sicarii [ Sat Oct 29, 2005 12:12 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Cheers typera! ;D I'm waiting patiently...honest! ;)
Aron

Author:  eugene33 [ Sat Oct 29, 2005 5:15 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

Hello,
I was playing  ;) with the script and yahoo RSS, and I'm running in another problem. I'm trying to get the content of the tag (which is the url for the full article)  in the maintext.
this is the code I added:
Quote:
$guid = addslashes($item['guid']);
$rss_feed2 = file_get_contents($guid);

My previous try displayed the url but what I would like is the full article :'(
If anyone could help me that would be great 

Author:  ghandi [ Sun Nov 06, 2005 3:58 pm ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

I can't get the second 'read on' link that goes to the feed article (offsite) ??? It won't show up in the maintext. I have tried several templates on Joomla 1.03 and mucked around with the code a lot but am getting nowhere. I even tried a number of feeds with no luck.

Anybody have any ideas? These are some parameters from the code. I don't see a $link anywhere.

$titletext
$introtext
$maintext
$publishdate

Author:  manipul8or [ Sun Nov 13, 2005 3:38 am ]
Post subject:  Re: RSS 2 Joomla / Mambo import script

I noticed there was a parameters section. Any ideas on how I could cause the script to auto add to frontpage ? Thanks.

Page 1 of 6 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/