RSS Feeder

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

Previous topic - Next topic

KahneFan

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.
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

SlammedDime

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...
                     

KahneFan

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...


<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?
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

bloodfire

#83
Quote from: SlammedDime on January 12, 2009, 11:04:09 PM
In the case of moreover.com [nofollow], 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?


DirtRider

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. "

Nao 尚

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.

SlammedDime

Quote from: bloodfire on January 14, 2009, 02:14:20 AM
Quote from: SlammedDime on January 12, 2009, 11:04:09 PM
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...
                     

Yağız...

Quote from: SlammedDime on January 13, 2009, 05:28:58 PM
Quote from: Yağız on January 11, 2009, 01:58:58 PM
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.

Sudhakar Arjunan

Quote from: SlammedDime on January 13, 2009, 01:13:16 PM
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

SlammedDime

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...
                     

SlammedDime

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...
                     

KahneFan

Error confirmed... says the one with 550 articles.
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

bloodfire

#92
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 [nofollow]: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

SlammedDime

Quote from: bloodfire 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
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?
Quote from: bloodfire on January 14, 2009, 09:46:03 PM
[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
Quote from: bloodfire on January 14, 2009, 09:46:03 PM
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...
                     

bloodfire

#94
ScheduledTasks.php


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 [nofollow]: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 [nofollow] not from my website... however, there are times it works...

shanksta13

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!

KahneFan

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.
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

shanksta13

Quote from: KahneFan 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.

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!

SlammedDime

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.

Quote from: bloodfire on January 15, 2009, 01:37:33 AM
ScheduledTasks.php


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...
                     

KahneFan

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?
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

Advertisement: