News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

RSS Feeder

Started by SlammedDime, January 11, 2009, 06:06:42 AM

Previous topic - Next topic

GazOutEast

Many thanks - I'll not nag you about it ;) just ask that you ad it to your "round tooit" wish list

Gaz
I have 20:20 vision - I can see anything bigger than 20" x 20"

SAFAD

Alright Guys I Will Really Appreciate Your Help
Best Regards
Sadaoui "SAFAD" Abderrahim - Lead Developer @ Electron Inc.

InfoStrides

#942
Quote from: Spuds on January 12, 2010, 03:30:34 PM
@Satfreak
find:
// Format the post
         $message =
($item->get_permalink() !== null ? '[url=' . $item->get_permalink() . ']' . $title . '[/url]' : $title) . '
' . ($item->get_date() !== null ? '[b]' . $item->get_date() . '[/b]
' : '') . '
' . $body . '

' . (!empty($source) ? '[b]' . $txt['rss_feed_source'] . ':[/b] ' . $source . '

' : '') . (!empty($feed['footer']) ? $feed['footer'] : '');


replace with:

// Format the post
         $message =
$title . '
' . ($item->get_date() !== null ? '[b]' . $item->get_date() . '[/b]
' : '') . '
' . $body . '

' .  (!empty($feed['footer']) ? $feed['footer'] : '');


Hello,

How can edit the code to have it in the following format?

Body content

Source: news link (permalink)
Thanks.

dynaweb

I noticed that when using the "Retrieve Full Article" function, if the url of the article source has a question mark in it then it will not attempt to fetch the article text.  Anyone have any ideas how to fix that?
FSS to HTML Widget [nofollow] - Snowboarding Forums [nofollow]

InfoStrides

I got the following errors while using the mod: Please help!

[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs-Editor.php on line 164
[01-Feb-2010 05:00:19] PHP Notice:  Use of undefined constant WIRELESS - assumed 'WIRELESS' in /home/xxxxxxxx/public_html/Sources/Subs.php on line 873
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1191
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1206
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1207
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1445
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1447
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::absolutize_url() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15036
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_IRI::absolutize() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 9209
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::is_isegment_nz_nc() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 3836
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::array_unique() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 5670
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  server in /home/xxxxxxxx/public_html/Sources/Subs.php on line 3699

Buah

#945
This feeder doesn't post.. I tried four different feeds and none of em works, so I think there's something wrong in this mod. No errors at error log.

Spuds

Quote from: infostrides on February 01, 2010, 01:22:16 AM
I got the following errors while using the mod: Please help!

[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::get_element() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15056
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs-Editor.php on line 164
[01-Feb-2010 05:00:19] PHP Notice:  Use of undefined constant WIRELESS - assumed 'WIRELESS' in /home/xxxxxxxx/public_html/Sources/Subs.php on line 873
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1191
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1206
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1207
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1445
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  browser in /home/xxxxxxxx/public_html/Sources/Subs.php on line 1447
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::absolutize_url() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 15036
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_IRI::absolutize() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 9209
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::is_isegment_nz_nc() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 3836
[01-Feb-2010 05:00:19] PHP Strict Standards:  Non-static method SimplePie_Misc::array_unique() should not be called statically, assuming $this from incompatible context in /home/xxxxxxxx/public_html/Sources/Subs-Rss.php on line 5670
[01-Feb-2010 05:00:19] PHP Notice:  Undefined index:  server in /home/xxxxxxxx/public_html/Sources/Subs.php on line 3699

You really should turn off strict and notice warnings on a production site, as  those errors are really nothing to worry about.  If fact most don't have anything to do with the rss mod .. for example it does not even change Subs.php, so all those notices about subs.php are RC2 issues such as wireless, or perhaps issues from other mods you installed

The simplepie error logs are from the rss mod, those are strict errors which basically mean something like yeah that works as coded, but your not strictly following the language construct so in some future release of php it might break.  Its really intended to help developers see what might break in their code with future releases of the language.

my advice is unless you are developing programs turn off that level of error logging and move along, nothing to see here, keep moving

Spuds

Quote from: dynaweb on January 25, 2010, 01:47:25 PM
I noticed that when using the "Retrieve Full Article" function, if the url of the article source has a question mark in it then it will not attempt to fetch the article text.  Anyone have any ideas how to fix that?

Does it just get the short article or nothing at all?

I would think either that the url needs to be encoded so its not truncated somewhere (you could try just changing the ? to a %3F) or that the article you are pointing to does not have a permalink or that the permalink does not point at the full story.  The feeder basically trys to follow the link contained in an rss story to get at the full feed.

InfoStrides

QuoteYou really should turn off strict and notice warnings on a production site, as  those errors are really nothing to worry about.  If fact most don't have anything to do with the rss mod .. for example it does not even change Subs.php, so all those notices about subs.php are RC2 issues such as wireless, or perhaps issues from other mods you installed

The simplepie error logs are from the rss mod, those are strict errors which basically mean something like yeah that works as coded, but your not strictly following the language construct so in some future release of php it might break.  Its really intended to help developers see what might break in their code with future releases of the language.

my advice is unless you are developing programs turn off that level of error logging and move along, nothing to see here, keep moving

Thank you for your prompt response.

How can I turn off strict and notice warnings on a production site?

I only experienced this error whenever I enable RSS Feeder. Most especially during feed posting.

Regards,

SlammedDime

Your host will have to disable it for you, as it's set in the PHP.ini configuration file.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

dynaweb

Anyone else experience the issue with the question mark in the URL?
FSS to HTML Widget [nofollow] - Snowboarding Forums [nofollow]

tbk22

I cant get this rss feed to work with the MOD

http://feeds.feedburner.com/SilkroadLatestNews

What might be the problem?
=)

SlammedDime

That's not an RSS feed... it's an HTML document.  You need an actual XML formatted RSS feed.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

tbk22

Quote from: SlammedDime on February 07, 2010, 01:54:08 PM
That's not an RSS feed... it's an HTML document.  You need an actual XML formatted RSS feed.

I know... But then what about this?

http://feeds.feedburner.com/SilkroadLatestNews?format=xml

Its on that page and its not working also with the mod
=)

steve51184

hey all i want to edit what is posted and i know the bit i need to edit is in ScheduledTasks.php but i'm not sure how to do it

// Format the post

$message =

($item->get_permalink() !== null ? '[url=' . $item->get_permalink() . ']' . $title . '[/url]' : $title) . '

' . ($item->get_date() !== null ? '[b]' . $item->get_date() . '[/b]

' : '') . '

' . $body . '



' . (!empty($source) ? '[b]' . $txt['rss_feed_source'] . ':[/b] ' . $source . '



' : '') . (!empty($feed['footer']) ? $feed['footer'] : '');


all i want is it to show to article and no links to the article or the date at the top etc

p.s. it's my blog s oi don't need to link back to it ;)

steve51184

#955
right i have it down to this but i can't get the date out without causing errors:

// Format the post
$message =
($item->get_date() !== null ? '' : '')
(. '' . $body . '' . )
(!empty($feed['footer']) ? $feed['footer'] : '');

InfoStrides

Quote from: ppbz on February 13, 2010, 04:33:14 AM
right i have it down to this but i can't get the date out without causing errors:

// Format the post
$message =
($item->get_date() !== null ? '' : '')
(. '' . $body . '' . )
(!empty($feed['footer']) ? $feed['footer'] : '');


Good! Please can I have it so that it shows the link to the feed after the post rather than at the begin?

For instance:

Date:
Post:
Source: link to the post instead of the website.

Thank you.

Regards,

Spuds

First the warning ... COMPLETELY UNTESTED

To hopefully help with all the questions of how to I format the message this way to that way I've munged the code to make it easier for folks unfamiliar with php to make changes as they see fit. 

What this does is break the message into sections that should be more obvious what they are, you can then combine in the order, and what sections you do or don't want to show.

Again this was just typed in and has not been tested, primarily because I'm not going to use it and also because I'm lazy.

So find:
// Format the post
         $message =
($item->get_permalink() !== null ? '[url=' . $item->get_permalink() . ']' . $title . '[/url]' : $title) . '
' . ($item->get_date() !== null ? '[b]' . $item->get_date() . '[/b]
' : '') . '
' . $body . '

' . (!empty($source) ? '[b]' . $txt['rss_feed_source'] . ':[/b] ' . $source . '

' : '') . (!empty($feed['footer']) ? $feed['footer'] : '');


replace with:

// Format the post
// title of the rss topic with a link back to this specific item in the feed if avaialble
$message_linked_title = ($item->get_permalink() !== null) ? '[url=' . $item->get_permalink() . ']' . $title . '[/url]' : $title;

// just the rss topic as a title, no link
$message_unlinked_title = $title;

// Your own text with a link back to the topic
$message_linked_mytext = ($item->get_permalink() !== null) ? '[url=' . $item->get_permalink() . ']' . 'Read More ...' . '[/url]' : '';

// the date of the feed item
$message_date = ($item->get_date() !== null) ? '[b]' . $item->get_date() . '[/b]' : '';

// the story
$message_body = $body;

// the source of the feed with a link back to it if available
$message_linked_source = (!empty($source)) ? '[b]' . $txt['rss_feed_source'] . ':[/b] ' . $source . '' : '';

// the source of the feed with no link
$message_unlinked_source = (!empty($feed_title)) ? $feed_title : '');

// any footer from the rss admin area
$message_footer = (!empty($feed['footer']) ? $feed['footer'] : '');

// put it all together however you like, use some, all or none .... use "\n" to add a newline between items,
// use your own conscience if you remove credit to other peoples work :o
// some examples to help
//
// default
// $message = $message_linked_title . $message_date . "\n" . $message_body . "\n\n" . $message_linked_source . "\n" . $message_footer;
//
// credit but no links
// $message = $message_unlinked_title . $message_date . "\n" . $message_body . "\n\n" . $message_unlinked_source . "\n" . $message_footer;
//
// just a title and body
// $message = $message_unlinked_title . "\n" . $message_body;
//
// adding in some of your own text
// $message = $message_unlinked_title . "\n" . $message_body . "\n\n" . $message_linked_mytext;
//
// all mixed up
// $message = $message_unlinked_source . "\n" . $message_body . "\n\n" . $message_date . "\n" . $message_footer . "\n" . message_linked_title;
//
// Our post as we see fit.
$message = $message_linked_title . $message_date . "\n" . $message_body . "\n\n" . $message_linked_source . "\n" . $message_footer;





steve51184

wow amazing post but just so you know it's $message and not $message_body

i used just

Quote$message = $body . "\n";

that gives me just the good stuff :)

Spuds

Quote from: zx71 on February 13, 2010, 12:31:51 PM
wow amazing post but just so you know it's $message and not $message_body

i used just

Quote$message = $body . "\n";

that gives me just the good stuff :)
Glad it helped ....

The idea is to form the $message with the various building blocks defined, for your case you would change the last line to be:

$message = $message_body . "\n"; 

but what you did has the same effect for your case.

Advertisement: