Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: [ADDON] Grab external feeds  (Read 21822 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Grab external feeds
« on: September 14, 2006, 01:36:00 PM »

We discussed in another thread that the original grabfeed.php was slow, and the Magpierss didn't work well (and in addition to that it didn't validate, that can't be allowed ;))...

Well I searched the web and found this: http://www.geckotribe.com/rss/carp/

Hehe, yummie. It works fast, and validates. It can be setup to work with MySQL or cache folders, and it's a treat. Just download it and...:

Unzip and upload the content of the Carp folder to a subfolder, preferably called "carp". Upload the carpsetup.php to the root, and load it into your browser. Follow instructions. (I chose cachefolders for some reason.)

Now, if everything worked out and you see feeds in the big gray box, you're done... It's working, eh ? Delete the carpsetup.php located at the root of your site, and carpsetupinc.php located in the carp folder. You can also delete phpftp.php and phptelnet.php in that same folder, they are not used by CaRP.

Now all is well, now we only need to get it up and running on our site, eh ? And we want to display the feeds of our own choice, don't we ? So... Open up your index.php:

In the top part of the index.php add:
Code: [Select]
require_once 'carp/carp.php';that is if you named the folder carp, hehe...

Mine looks like:
Code: [Select]
<? session_start();
include ("snews.php");
include ("audit.php");
ob_start("ob_gzhandler");
require_once 'carp/carp.php';?>
Now you must choose a place for the feeds to show up on your site. When you've done that you paste this:(with courtesy to Avenir, who made the process of coding it a bit faster than me ;))
Code: [Select]
<?php
CarpConf
('cborder','');
CarpConf('maxitems',1);
CarpConf('maxidesc',75);
CarpConf('poweredby','');
CarpConf('cacheinterval',120);
echo 
'<p>'CarpCacheShow('http://www.brauck.nl/rss.xml');echo '</p>';
echo 
'<p>';CarpCacheShow('http://www.free-css-templates.com/rss/');echo '</p>';
echo 
'<p>';CarpCacheShow('http://p-ahlqvist.com/rss.xml');echo '</p>';
echo 
'<p>';CarpCacheShow('http://www.cssplay.co.uk/feed.xml');echo '</p>';
?>
And you're good to go. If you want more feeds from each site, change CarpConf('maxitems',1);, number of characters in descrition, change CarpConf('maxidesc',75); and so on... More feeds ? Just copy a line with a feed in it, and change the URL to whatever you want...

Cherrs Patric.
« Last Edit: January 04, 2009, 03:36:47 AM by philmoz »
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

Patrik

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 89
    • http://pawe.se/
[ADDON] Grab external feeds
« Reply #1 on: September 14, 2006, 02:09:14 PM »

Great Patric, it sure looks great :)

EDIT: And I love your way of writing descriptions! The Patricway...wonderfull :)
Logged
Visit me: http://pawe.se/

elkie

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
[ADDON] Grab external feeds
« Reply #2 on: September 14, 2006, 07:39:12 PM »

Excellent addon and explanation.  However, I believe there are better choices than carp as the RSS reader.  Although it is free, it is not opensource (they would like you to upgrade to paid version), you need to register to download, it has no real community, somewhat limited as in if you wanted images in your feeds you would need to purchase the upgrade.  I had spent the last month looking at various rss feeds and I tried carp and it worked but I decided not to use it for the reasons as stated.

Simplepie found here www.simplepie.org works as well or I believe better than carp but it is open source, for lack of better term more Web 2 friendly, has strong community who have already created a few plugins for CMS's (textpattern, wordpress)
I used your excellent post on integrating Carp and did the same with Simplepie by downloading the multiple feed http://simplepie.org/blog/2006/08/23/sorting-multiple-feeds-by-time-and-date/ and grabbed 2 from each feed you supplied and had them sorted by date so the latest post is first.  An example is here at www.eelkema.net/sNews/index.php  (sorry I am new to sNews so just installed today and this is just the base install but you get the idea)  If there is interest, I can post later on how I set it up, but basically followed Patric example for Carp and used simplepie instead.

I hope this doesn't come off as impolite, I love sNews so far and believe that simplepie is a better platform to build an addon than Carp.  I look forward to hearing any feedback and look forward to working more in this community once I become more familiar with sNews.

Respectfully,

Brian Eelkema
Logged

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
[ADDON] Grab external feeds
« Reply #3 on: September 14, 2006, 08:41:14 PM »

Hi Brian... and Welcome to our sNews Community. About being impolite... that's OK... you were granted 3 Free Impolite Coupons when you signed up so you still have 2 more and, after they are used up... well... no more OK? (just kidding, hehe)

Seriously, you are not being impolite at all. In fact, bringing your mod to the Forum is a good thing. We welcome a diversity of opinion and approach as long as it comes with respect for all fellow sNoozers here on the Forums. We enjoy a little fun but we do believe in showing consideration and respect.

Please... do share your mod in this Topic. Again... it is most welcome! :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Grab external feeds
« Reply #4 on: September 14, 2006, 08:43:12 PM »

Hey, Brian. Not impolite at all, aux contraire mon ami, hehe... Excellent post, and please, Brian, do post how you set it up. I'm a basic PHP imbecille and need an hour per your five minutes to understand and setup things like this ;)... So please post an explanation, and do it in laymens terms ;)...

I did find this and thought it was ok, I'm a bit ignorant that way, not to knowledgable, but more of a glad chum when things get to work...So you might be, probably are, correct in your assumption that  Simplepie is better.
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

Fred K

  • sNews Dude
  • ULTIMATE member
  • *****
  • Karma: 131
  • Posts: 2798
[ADDON] Grab external feeds
« Reply #5 on: September 14, 2006, 08:55:30 PM »

Well, SimplePie fits my needs perfectly. And I also think that the documentation could serve as a beacon/guiding light/inspiration... :D

elkie

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
[ADDON] Grab external feeds
« Reply #6 on: September 14, 2006, 10:30:59 PM »

Thanks for the feedback.  I will find some time in the next day or 2 to post the howto.  Looking forward really getting to know sNews and its community.  I had just spent a month working with different rss parsers so this area I had some knowledge but in other areas I will seek many of your cumulative wisdoms.

Brian
Logged

mosh

  • Dev Invitee
  • Hero Member
  • *****
  • Karma: 77
  • Posts: 521
  • Awesome day :)
[ADDON] Grab external feeds
« Reply #7 on: September 21, 2006, 07:59:20 PM »

very good addon thank you :)

how can i show feeds on the articles or pages i creat with in snews ?
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Grab external feeds
« Reply #8 on: September 22, 2006, 09:08:32 AM »

Mhm, if I understand your questiong properly, you just should have to put that last code snippet inside the article or page you want it to appear in...
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

mosh

  • Dev Invitee
  • Hero Member
  • *****
  • Karma: 77
  • Posts: 521
  • Awesome day :)
[ADDON] Grab external feeds
« Reply #9 on: September 22, 2006, 12:20:55 PM »

what code should i use to includ with in the articles ?

i have try :
<?php CarpCacheShow('http://www.geckotribe.com/press/rss/pr.rss'); ?>

and i have try :
<?php
CarpConf('cborder','');
CarpConf('maxitems',1);
CarpConf('maxidesc',75);
CarpConf('poweredby','');
CarpConf('cacheinterval',120);
echo '<p>'; CarpCacheShow('http://www.brauck.nl/rss.xml');echo '</p>';
echo '<p>';CarpCacheShow('http://www.free-css-templates.com/rss/');echo '</p>';
echo '<p>';CarpCacheShow('http://p-ahlqvist.com/rss.xml');echo '</p>';
echo '<p>';CarpCacheShow('http://www.cssplay.co.uk/feed.xml');echo '</p>';
?>

but nothing.

it works only when i set it in the index.php page layout .... hmm :)
« Last Edit: January 04, 2009, 03:38:15 AM by philmoz »
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Grab external feeds
« Reply #10 on: September 22, 2006, 12:44:48 PM »

well you could create an txt or php file that contains the script  and then in the article you type:

Code: [Select]
[include]path/to/script.txt[/include]I think that this should work... ? I have my google adsense included that way.

My solution for the feed grabber is to hardcode it into the index.php (ver 1.4) as I want it to be visible on the FP at all times...
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

mosh

  • Dev Invitee
  • Hero Member
  • *****
  • Karma: 77
  • Posts: 521
  • Awesome day :)
[ADDON] Grab external feeds
« Reply #11 on: September 22, 2006, 01:23:48 PM »

OMG :) it's working like magic ..... THANK YOU PATRIC :)
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4957
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[ADDON] Grab external feeds
« Reply #12 on: September 22, 2006, 01:26:51 PM »

Ahhhh, great to be able to be of assistance ;). Glad you got it running...
Logged
My sNews site
"It's only dead fish that goes with the flow... "
Updated, online again - Free designs

mosh

  • Dev Invitee
  • Hero Member
  • *****
  • Karma: 77
  • Posts: 521
  • Awesome day :)
[ADDON] Grab external feeds
« Reply #13 on: September 22, 2006, 01:44:48 PM »

awesome ...... now i can really do some work hehehehe soooo cool man thanks again :)
Logged

philmoz

  • High flyer
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 2001
    • fiddle 'n fly
[ADDON] Grab external feeds
« Reply #14 on: September 26, 2006, 01:24:16 PM »

for those in this thread using simplepie, have you managed to get it to read the rss of this site??
Logged
Of all the things I have lost, it is my mind that I miss the most.
Pages: [1] 2 3