Advertisement:

Author Topic: RSS Feeder  (Read 372615 times)

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: RSS Feeder
« Reply #80 on: January 13, 2009, 10:13:28 PM »
But THIS doesn't show the video like THIS. It's the same feed. Both my sites, one using SMF (obviously) the other with Drupal.

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #81 on: January 13, 2009, 10:19:55 PM »
That's because the RSS feed is not just a link to the video... it has the whole <object> tag, which would be parsed out because it is an html tag.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: RSS Feeder
« Reply #82 on: January 13, 2009, 11:28:44 PM »
So there would be no way to pull the <object> tag out?

Now that you say that, it reminds me that there is an area of the Drupal aggregate system which allows admins to specify the tags they will allow through. Which I DID have to add <object> to my admin to allow the videos and players. Do you think this could be a possibility with your mod? This would allow admins complete access to tags they feel are OK to be passed through. Below is a screen shot of the Drupal admin screen. Their defaults seem pretty safe...

Code: [Select]
<a> <b> <br> <dd> <dl> <dt> <em> <i> <li> <ol> <p> <strong> <u> <ul> <img>

However, I guess with SMF, you have to rebuild all of these in order to allow them through to a post?

Offline bloodfire

  • Semi-Newbie
  • *
  • Posts: 15
Re: RSS Feeder
« Reply #83 on: January 14, 2009, 02:14:20 AM »
In the case of moreover.com, I would not use the retrieve full article option.  It will end up posting just the description of the item if the regex isn't matched.  It could possibly be changed to not post anything if the regex isn't matched.

If I were to implement something like that, then your idea of multiple feeds with the same url would probably work okay.

I've tried the multiple feeds method... it works alright but then after awhile I get the 500 Internal server error. Guessed all i have to do it increase the timeout value from 60 to a higher value? If so, any maximum value?

« Last Edit: January 14, 2009, 02:24:14 AM by bloodfire »

Offline DirtRider

  • SMF Hero
  • ******
  • Posts: 1,415
  • Gender: Male
  • Just Looking
    • TriumphTalk
Re: RSS Feeder
« Reply #84 on: January 14, 2009, 02:57:34 AM »
Great mod I have been waiting for this one  :D
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Offline Nao 尚

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,928
  • Gender: Male
    • wedgebook on Facebook
    • Wedge
Re: RSS Feeder
« Reply #85 on: January 14, 2009, 03:21:14 AM »
Just FYI: anything will parse through Aeva when you call parse_bbc(). Still, it requires links to be autolinked ([ url ] tag).
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #86 on: January 14, 2009, 05:04:49 AM »
In the case of moreover.com, I would not use the retrieve full article option.  It will end up posting just the description of the item if the regex isn't matched.  It could possibly be changed to not post anything if the regex isn't matched.

If I were to implement something like that, then your idea of multiple feeds with the same url would probably work okay.

I've tried the multiple feeds method... it works alright but then after awhile I get the 500 Internal server error. Guessed all i have to do it increase the timeout value from 60 to a higher value? If so, any maximum value?


For a 500 error, you'll need to check your server error logs to see what caused the error.  If it was a timeout value, that would probably show in the forum error log.

Nao - good to know, thx.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
Re: RSS Feeder
« Reply #87 on: January 14, 2009, 06:26:37 AM »
There is an error with Turkish characters. It shows '?' instead of 'ı', 'İ', 'ğ', 'ş', 'Ş'.
I've fixed this bug... I didn't realize how powerful Magpie is in parsing RSS and returning results.  I added a line that sets the output character set of Magpie to be whatever the forum is, so it now parses your feed properly that you gave as an example...
Thank you. I'm waiting for the new release.

Offline Sudhakar Arjunan

  • Sophist Member
  • *****
  • Posts: 1,227
  • Gender: Male
  • SMF is the best forum tool
    • IT Acumens - Webdesigning & Webhositing services in Chennai
Re: RSS Feeder
« Reply #88 on: January 14, 2009, 08:25:26 AM »
I'm not sure where you came up with those regex's.... For your first one... that has a lot of video feeds... so to extract the text from the video feeds, you'd want to use

~<div id="videoText">.*<\/div>(.*)<\/div>~siU (untested, but should work)

And for the second one

~<p><font class="sb13">(.*)<\/font><\/p>~siU (again, untested, but should work)

That worked perfectly.

Thanks a lot for it SlammedDime.

I have an suggestion.  Is there any way to add tags on the post using vbgamer tags mod.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #89 on: January 14, 2009, 10:17:31 AM »
not sure, i've never looked into the tags mod, not sure how hard it would be to implement... I don't normally try and code to work with other mods, only because if they are ever updated, I don't want to break functionality with my mods.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #90 on: January 14, 2009, 10:45:54 AM »
I've just noticed a few bugs on my live site that I'm testing this on, one due to a bug in SMF, but also revealed why the Mark as Read wasn't working properly and my lack of understanding...

The mark-as-read option only works for the user who the task was run under, be it a guest visiting your site that triggers the tasks, another user, or yourself, because of the createPost function that uses $user_info['id'] instead of $posterInfo['id'].  Regardless though, that still only means that whatever posterId is used will have the mark-as-read option enabled.

Because of that, I'm going to remove that option, as making the topic marked as read for everyone on the board would be exhausting, especially on large boards.

I'll also be filing a bug report on the issue as well for SMF.

I also have another error in my error log regarding an undefined index error for 'description'..

 Apply Filter: Only show the error messages of this URL  http://www.ccwlaws.com/forum/index.php?action=admin;area=scheduledtasks
Apply Filter: Only show the errors with the same message
8: Undefined index: description
Apply Filter: Only show the errors from this file
File: /home/mattzuba/public_html/ccwlaws.com/forum/Sources/ScheduledTasks.php
Line: 1666

Can anyone else confirm or deny that error as well?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: RSS Feeder
« Reply #91 on: January 14, 2009, 11:01:58 AM »
Error confirmed... says the one with 550 articles.

Offline bloodfire

  • Semi-Newbie
  • *
  • Posts: 15
Re: RSS Feeder
« Reply #92 on: January 14, 2009, 09:46:03 PM »
SlammedDime, I've encountered the same error... including errors on Subs-Rss.php and subs-post.php

 Apply Filter: Only show the error messages of this URL  http://www.bruneimarket.co.cc/index.php?action=admin;area=scheduledtasks [nofollow]
Apply Filter: Only show the errors with the same message
8: Undefined offset: 1
Apply Filter: Only show the errors from this file
File: /home/bnmart/public_html/Sources/ScheduledTasks.php
Line: 1733


 Apply Filter: Only show the error messages of this URL  http://www.bruneimarket.co.cc/index.php?action=admin;area=scheduledtasks [nofollow]
Apply Filter: Only show the errors with the same message
8: Undefined index: description
Apply Filter: Only show the errors from this file
File: /home/bnmart/public_html/Sources/Subs-Rss.php
Line: 497


[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  utf8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1272
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  utf8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1274
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  server in /home/bnmart/public_html/Sources/Subs-Post.php on line 1290
[14-Jan-2009 05:08:29] PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1290
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  character_set in /home/bnmart/public_html/Sources/Subs-Post.php on line 1233


14-Jan-2009 20:00:37] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to www.theborneopost.com:80 [nofollow] (Connection refused) in /home/bnmart/public_html/Sources/Subs-Rss.php on line 2040
[14-Jan-2009 20:00:59] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/bnmart/public_html/Sources/ScheduledTasks.php:1734) in /home/bnmart/public_html/Sources/ScheduledTasks.php on line 183
[14-Jan-2009 20:00:59] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/bnmart/public_html/Sources/ScheduledTasks.php:1734) in /home/bnmart/public_html/Sources/ScheduledTasks.php on line 184


Sometimes it works fine.... without any errors
« Last Edit: January 14, 2009, 09:47:51 PM by bloodfire »

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #93 on: January 14, 2009, 10:06:54 PM »
SlammedDime, I've encountered the same error... including errors on Subs-Rss.php and subs-post.php

 Apply Filter: Only show the error messages of this URL  http://www.bruneimarket.co.cc/index.php?action=admin;area=scheduledtasks
Apply Filter: Only show the errors with the same message
8: Undefined offset: 1
Apply Filter: Only show the errors from this file
File: /home/bnmart/public_html/Sources/ScheduledTasks.php
Line: 1733


 Apply Filter: Only show the error messages of this URL  http://www.bruneimarket.co.cc/index.php?action=admin;area=scheduledtasks
Apply Filter: Only show the errors with the same message
8: Undefined index: description
Apply Filter: Only show the errors from this file
File: /home/bnmart/public_html/Sources/Subs-Rss.php
Line: 497
These two are caused by this mod... although I'm unsure of the first one.  Can you post what line of code you have on that line?
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  utf8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1272
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  utf8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1274
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  server in /home/bnmart/public_html/Sources/Subs-Post.php on line 1290
[14-Jan-2009 05:08:29] PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 8 in /home/bnmart/public_html/Sources/Subs-Post.php on line 1290
[14-Jan-2009 05:08:29] PHP Notice:  Undefined index:  character_set in /home/bnmart/public_html/Sources/Subs-Post.php on line 1233
These are not caused by this mod... the function that those error fall in is not called by this mod
14-Jan-2009 20:00:37] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to www.theborneopost.com:80 (Connection refused) in /home/bnmart/public_html/Sources/Subs-Rss.php on line 2040
[14-Jan-2009 20:00:59] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/bnmart/public_html/Sources/ScheduledTasks.php:1734) in /home/bnmart/public_html/Sources/ScheduledTasks.php on line 183
[14-Jan-2009 20:00:59] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/bnmart/public_html/Sources/ScheduledTasks.php:1734) in /home/bnmart/public_html/Sources/ScheduledTasks.php on line 184


Sometimes it works fine.... without any errors
The first one caused the second two, but the first one isn't the fault of the mod, but because the php function was not able to connect to the server specified.  I'm not sure they even were caused by the mod, unless you're trying to call a RSS feed from your own site.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline bloodfire

  • Semi-Newbie
  • *
  • Posts: 15
Re: RSS Feeder
« Reply #94 on: January 15, 2009, 01:37:33 AM »
ScheduledTasks.php

Code: [Select]
1731 $matches = array();
1732 preg_match($feed['regex'], $browser->results, $matches);
1733 $body = $matches[1];


14-Jan-2009 20:00:37] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to www.theborneopost.com:80 [nofollow] (Connection refused) in /home/bnmart/public_html/Sources/Subs-Rss.php on line 2040

as for this, it stops there everytime, only to this url... this is from bignewsnetwork.com not from my website... however, there are times it works...
« Last Edit: January 15, 2009, 01:56:37 AM by bloodfire »

Offline shanksta13

  • Jr. Member
  • **
  • Posts: 227
Re: RSS Feeder
« Reply #95 on: January 15, 2009, 10:53:58 AM »
Okay good, I thought I was the only one having the "Mark as Read" option.  That sucks though, that feature is the one reason I really liked the mod.  I've decided to pull it from my live site now, because the relevant feeds I was using post rather frequently and I don't want to smother my members.

The Mark as Read option was exactly what I was looking for, something that allowed users to view the articles if they wanted to, but wouldn't interfere with the normal functioning of the forum (i.e. showing up in the unread posts list).

Anyway, good try on the mod.  If you guys ever figure out how to get that Mark as Read option working, this mod would be incredible.  Thanks for all the hard work, I almost thought it would be the one I was looking for.

Good luck on the mod!

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: RSS Feeder
« Reply #96 on: January 15, 2009, 11:19:07 AM »
There's a way you can achieve the above, but it will not create a new topic per article.

0) You may want to create a new board for this, keep that in mind for step 8.

1) Install Simple Portal
2) DISABLE Simple Portal (Configuration Menu)
3) DISABLE Redirect to Simple Portal
 - The above two steps will make you forum look/run as usual
4) Go to: Blocks --> Add Block --> (bottom of page) RSS Feed Block
5) Fill in the pertinent top information
6) For the "Column" drop down select {TOP} or {BOTTOM} You may change this later, I would suggest Top.
7) On the bottom "Display Options" check "Advanced Options"
8 ) Click the "[ +] Select Boards" and select which board of your forum this feed applies to (this is where you may want to create a new board just for this feed)
9) Click "Add Block"

Now go to the board which you assigned this to and you should see all feeds above/below the posts in that board. This is where selecting Top/Bottom will depend if you want comments below the articles or above the articles. Using "Top" above will make it so that members can read the articles, then comment below.

Is this the best method, probably not, but it will list your articles and not effect your board new/no new system.

Offline shanksta13

  • Jr. Member
  • **
  • Posts: 227
Re: RSS Feeder
« Reply #97 on: January 15, 2009, 11:25:50 AM »
There's a way you can achieve the above, but it will not create a new topic per article.

0) You may want to create a new board for this, keep that in mind for step 8.

1) Install Simple Portal
2) DISABLE Simple Portal (Configuration Menu)
3) DISABLE Redirect to Simple Portal
 - The above two steps will make you forum look/run as usual
4) Go to: Blocks --> Add Block --> (bottom of page) RSS Feed Block
5) Fill in the pertinent top information
6) For the "Column" drop down select {TOP} or {BOTTOM} You may change this later, I would suggest Top.
7) On the bottom "Display Options" check "Advanced Options"
8 ) Click the "[ +] Select Boards" and select which board of your forum this feed applies to (this is where you may want to create a new board just for this feed)
9) Click "Add Block"

Now go to the board which you assigned this to and you should see all feeds above/below the posts in that board. This is where selecting Top/Bottom will depend if you want comments below the articles or above the articles. Using "Top" above will make it so that members can read the articles, then comment below.

Is this the best method, probably not, but it will list your articles and not effect your board new/no new system.

Awesome, I had a already created a new board for this RSS Feeder and I haven't deleted it yet, so I very well may do this.  If I do, I'll be sure to let you know and thank you!

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: RSS Feeder
« Reply #98 on: January 15, 2009, 12:16:53 PM »
shanksta - before I release the next version, I'll take a hard look at how I can make it work.  The only way I think I can do it is to mark the whole board that the news feed is posted to as read, but then if you have one feed you don't want marked as read, but one feed you do, and they post to the same board, then you're SOL.

ScheduledTasks.php

Code: [Select]
1731 $matches = array();
1732 preg_match($feed['regex'], $browser->results, $matches);
1733 $body = $matches[1];


14-Jan-2009 20:00:37] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to www.theborneopost.com:80 (Connection refused) in /home/bnmart/public_html/Sources/Subs-Rss.php on line 2040

as for this, it stops there everytime, only to this url... this is from bignewsnetwork.com not from my website... however, there are times it works...

Thanks for posting that code, I've corrected the code so an error will no longer be thrown in the first case above.

For the fsockopen error - it simply means fsockopen wasn't able to connect to the specified server, normally because the server denied the request.  Nothing I can really do to work around it except suppress the error, which I've done for the next version.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline KahneFan

  • SMF Hero
  • ******
  • Posts: 1,850
  • Gender: Male
    • I Post You Post
Re: RSS Feeder
« Reply #99 on: January 15, 2009, 12:39:53 PM »
SD, if you figure out a way to let images/html through, you may want to have a "Settings" page which changes settings for the whole mod. If you added this page, you could place "Mark Feeds As Read" in this area, which would let people know that it is a setting for all feeds. You could then place a small font note below it stating "All feeds and posts on this board will be marked as read" or something of that nature.

Side question: ...will you be allowing images through on the next version?