OBBLM - RSS Feed

However you play online - Java, Vassal, Email, Cyanide etc - talk about it here.
This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

Post Reply
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

OBBLM - RSS Feed

Post by Vanguard »

I'm trying to use the OBBLM RSS feed module to cross-post all updates to our league facebook group. However, it's not co-operating and I suspect it due to the RSS feed not being entirely RSS2.0 compliant. I'm tinkering with it at the moment to see if I can fix it, but could do with a few pointers.
It looks like the generateNewsRssFeed() is called from somewhere to generate the rss.xml file but I can't see where from. I'd guess this is on some kind of schedule to regularly update it. Anyone able to point me in the right direction?

Reason: ''
Image
Image
juergen
Emerging Star
Emerging Star
Posts: 448
Joined: Sat Jan 04, 2003 4:50 pm
Location: Vienna, Austria

Post by juergen »

I will try to find it. I wrote it a long time ago. As far as i remember my suggestion to update it after a ge has been submitted was rejected
Don't know when I find time for it

Reason: ''
Juergen

Creator of Elfball.org - the Elfball website officialy approved by Impact Miniatures
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - RSS Feed

Post by Vanguard »

Cheers. GE?

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - RSS Feed

Post by Vanguard »

Ahah! It seems clicking on the RSS option on the OBBLM homepage causes it to recreate the rss.xml file.
I'd guess this isn't the only way it happens, but it's letting me test my tinkering for the time being.

Reason: ''
Image
Image
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - RSS Feed

Post by Vanguard »

Soo... we have some success.
I've edited obblm/modules/rss/class_rss.php to change the output to the rss.xml file.

I've replaced line 176 with:

Code: Select all

$el_item->appendChild($dom->createElement('pubDate', date('r', strtotime($item->date))));
This makes the date format compliant with the RFC-822 requirement for RSS feeds.

I've then added a new line immediately after that:

Code: Select all

$el_item->appendChild($dom->createElement('guid', $this->link . 'index.php?' . date('U', strtotime($item->date))));
This is a bit hacky, but it gives each entry in the feed a GUID (Global Unique Identifier) which is created by taking the site address and appending the timestamp (in seconds) of the post. By default, GUID is expected to be a valid hyperlink, this creates a fake hyperlink that'll go to the main site rather than direct to the post, as OBBLM does not have direct linking for individual posts. The site will ignore the timestamp in the address, so it won't cause any errors. A better solution would be to implement the GUID with isPermaLink set to false but I couldn't figure out an easy way of doing that.

With those changes in place, the rss.xml file will then work with RSS Graphitti which I'm using to cross-post all updates to the OBBLM site to our League Facebook group.

I'm sure there's a much more elegant solution that this, but it works if anyone wants to use it.

Reason: ''
Image
Image
User avatar
nicholasmr
Experienced
Experienced
Posts: 110
Joined: Mon Oct 22, 2007 1:01 pm
Location: Copenhagen, Denmark
Contact:

Re: OBBLM - RSS Feed

Post by nicholasmr »

Vanguard, could you post all the changes you made at code.google.com/p/obblm ? I'd like to implement them into the main distribution.

Reason: ''
NickJMereel
Rookie
Rookie
Posts: 39
Joined: Sat Apr 06, 2013 5:23 pm

Re: OBBLM - RSS Feed

Post by NickJMereel »

has this been done?
I would like the RSS to do the same with our fb page and im scared of altering our code?

And I need to use grafitti to populate the info on fb. Any tips on that for me?
Cheers
Nick

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - RSS Feed

Post by Vanguard »

Probably not, I missed Nicholas's request to post the info to code.google. I've added it now.

I'm happy to send you a copy of my modified file if you like, you'd then just need to replace the existing one with it.
As for Graphitti it's pretty straightforward. You just link it to the rss feed by giving it the file location (your.domain.com/rss.xml) and where you would like updates posted to - your Facebook group.
If you're having any specific problems, let me know some details and I'll take another look. Bear in mind that Graphitti only checks every so often and won't back date posts. I've seen it take a day sometimes for posts to appear.

Reason: ''
NickJMereel
Rookie
Rookie
Posts: 39
Joined: Sat Apr 06, 2013 5:23 pm

Re: OBBLM - RSS Feed

Post by NickJMereel »

And it can post into fb group?
I assume it signs in to my account? Or could I create a new fb account just to post???

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - RSS Feed

Post by Vanguard »

Yes, it can post to Groups. Effectively it posts as you, so anywhere you can post, it can.
You could create a new account for it - I have considered a League Commissioner account, but so far that has seemed like too much hard work. ;)

Reason: ''
NickJMereel
Rookie
Rookie
Posts: 39
Joined: Sat Apr 06, 2013 5:23 pm

Re: OBBLM - RSS Feed

Post by NickJMereel »

Cool. I better have an experiment with it. I like the idea of a second "commish" account

Reason: ''
Post Reply