Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetFeed - displaying RSS feeds [beta]
#1
I have made a rudimentary plugin to display RSS feeds in GetSimple (to use it myself, until some decent PHP coder makes a better one) ;-)

GetFeed v0.4.1 beta - GetSimple Feed Reader/Fecther
Download: http://www.cyberiada.org/cnb/getsimple-plugin-getfeed/

Setup:
- Create a 'getfeed' directory in your plugins folder. Create another directory inside of this one, named 'magpierss'.
- Download MagpieRSS libraries (not included in the plugin) from http://sourceforge.net/projects/magpierss/files/ and uncompress it inside the 'magpierss' folder.
- Unzip the GetFeed plugin in your GetSimple plugins folder.

(Once the getfeed functions are first called, a 'getfeedcache' directory will be created in your GetSimple's data folder, to store feed cache files.)

Demos: http://webs.org.es/getfeed/

Usage
Insert calls to GetFeed functions in your template or components (e.g. sidebar)

Available functions:

getfeed_list_titles( FEEDURL [ , NUMPOSTS] )
sample function to display a list titles linking to source post.

getfeed_echo_posts( FEEDURL [ , NUMPOSTS] )
sample function, displays full posts. Customizable with CSS styles.

getfeed_output( FEEDURL , HTMLSTRING [ , NUMPOSTS ] )
customize feed output (this function is called by the first two)

Parameters:

FEEDURL is a string, the URL of the feed.

NUMPOSTS is optional: the maximum number of items to be displayed. Default is 0 = no maximum (all items)

In getfeed_output, HTMLSTRING must be a string containing HTML code, with the following keywords:

{{title}} - the post title
{{link}} - URL of the post
{{description}} - post body contents
{{date}} - date and time (if the script can get it)
{{pid}} - post ID. 1=first, etc. Maybe be useful for e.g. different styles (as used in sample function getfeed_echo_posts)

These keys/shortcodes that will be replaced by their correspondent values for each feed item.
Reply
#2
Greet work Carlos !
Sorry for my little english :rolleyes:

Thx for GS
Reply
#3
Thank you.
Not good code nor implementation, but... it works for me :-) and I thought it could be useful to someone else.
Reply
#4
I have not bundled MagpieRSS libraries with this (sort-of-)plugin because:

- I'm not sure if I have to include the full package, etc. (will read the GPL)

- I am thinking whether it would be better to put them on a -required- separate plugin. This way, other -future- plugins that use RSS feeds (e.g. a Twitter gadget) could include them without having duplicate libraries.
Reply
#5
Hum i have a blank page in the plugins page admin, any ideas ?

I test a chmodd 777 in folder and file and the same.
Sorry for my little english :rolleyes:

Thx for GS
Reply
#6
You have to download MagpieRSS:
http://sourceforge.net/projects/magpiers...z/download
then unzip its contents into 'plugins/getfeed/magpierss' (create the subfolders if you don't have them)
Reply
#7
Thx a lot it's ok now Wink
Sorry for my little english :rolleyes:

Thx for GS
Reply
#8
Hi I can't get the twitter code working, yet see its fine on yours! can u help??
Reply
#9
I put the code
Code:
<? php
if (return_page_slug ()==' sample-blogsearch-feed ') (
  getfeed_echo_posts ('http://blogsearch.google.com/blogsearch_feeds?lr=&q =% 22getsimple% 22 & ie = utf-8 & num = 10 & output = rss', 10);
)?>
and did not see
Reply
#10
daguy Wrote:Hi I can't get the twitter code working, yet see its fine on yours! can u help??
Did it work with any other RSS feed besides Twitter?
Reply
#11
Oleg06,

The code you posted has lots of extra space characters, did you insert them to post it here?

You must also change the 'if' to match your page's slug. In your example URL it would be:
Code:
<?php
if (return_page_slug()=='rss') {
  getfeed_echo_posts('http://blogsearch.google.com/blogsearch_feeds?lr=&q=%22getsimple%22&ie=utf-8&num=10&output=rss',10);
} ?>
Reply
#12
I tried this plugin but i have problem with displaying for Vietnamese (Unicode)

I already updated the code here in getfeed.php

#Tell Magpie to use UTF-8 encoding
define('MAGPIE_INPUT_ENCODING', 'UTF-8');
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');

define('GETFEED_DATE_FORMAT', 'M jS, Y'); // default date format

define('MAGPIE_CACHE_DIR', GSDATAPATH.'/getfeedcache'); // where to store MagpieRSS cache files
require_once GSPLUGINPATH.'/getfeed/magpierss/rss_fetch.inc';

Thanks for any help.
Reply
#13
Magpie might understand it, but is your server configured to output UTF8 pages?

In Firefox, right click the page and choose “View Page Info”. There you can see what encoding your server is telling the browser to use.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#14
vipdesign,

Please post here or send me (forum email or PM) some sample RSS feed, to do some test.
Reply
#15
hi Carlos,

<p><?php
if (return_page_slug()=='test-new-vietnam') {
getfeed_echo_posts('http://www.thanhnien.com.vn//_layouts/NewsRss.aspx?List=&MainCat=%C4%90%E1%BB%9Di+s%E1%BB%91ng',15);
} ?></p>

you can test above code for vietnamese.

Thanks
Reply
#16
why such things?
Reply
#17
vipdesign, Oleg06: Thanks for your comments, and for testing this plugin!

Please test this patched version 0.2 beta:
http://www.cyberiada.org/cnb/data/upload....2beta.zip

Oleg: I hope to fix in another revision those notices you get when debug mode enabled.
Reply
#18
Thanks, it works
Reply
#19
Call me stupid Wink but how is a php file read with the following contents?
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
<title></title>
<link></link>
<item>
    <title></title>
    <link></link>
    <pubDate></pubDate>
    <description><![CDATA[]]></description>
</item>
</channel>
</rss>
Reply
#20
Sorry, I don't understand your question.
Reply
#21
Minor update. GetFeed 0.3 beta:
http://www.cyberiada.org/cnb/data/upload....3beta.zip

Suppreses notices when debug mode on, reported by Oleg06.
Reply
#22
@Carlos

I want to read a php file with mentioned XML context. When I call this file with
Code:
getfeed_list_titles('http://www.domain.nl/file.php',15);
nothing happens, only a blank screen?
Reply
#23
Rene,
Please enable GetSimple debug mode and let me know what errors you get; Or else, PM or e-mail me the URL, to do some test.
Reply
#24
Why do not the links? http://artelena-photo.ru/news
Code:
http://www.digital-photo.ru/null/news/foto/id/186133
Folder null here quite superfluous
Reply
#25
Oleg,

Sorry I don't understand.
Please PM or email me the feed URL
Reply




Users browsing this thread: 3 Guest(s)