Native XBMC RSS feed for new shows and movies

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MDPauley Offline
Senior Member
Posts: 264
Joined: Mar 2004
Reputation: 0
Location: Centreville, Va
Post: #1
What I did...
  1. Created XBMC\web\rss.asp
  2. Copy and Paste the code below in to the file
  3. Add URL to your RssFeeds.xml file


Code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>New in XBMC Video Library</title>
<link>http://localhost:8080/rss.asp/</link>
<description>This is my rss 2 feed for newest xbmc movies</description>
<language>en-us</language>

<%
var Response;
var setHeader;
var resetHeader;

setHeader = xbmcAPI("setresponseformat(webheader;false;webfooter;false;opentag;<tag>;closetag;</tag>;openRecord;<item>;closeRecord;</item>;openField;\n;closeField;\n;closefinaltag;false)");
Response = xbmcAPI("QueryVideoDatabase(select '<title>', C00, ' (', c07, ')', '</title>', '<description>',c01,'</description>' from movie ORDER BY idMovie DESC LIMIT 15)");
write(Response);

Response = xbmcAPI("QueryVideoDatabase(select '<title>', tvshow.c00, ' - ', episode.C00, '</title>', '<description>', episode.c01,'</description>' from episode JOIN tvshowlinkepisode ON episode.idEpisode = tvshowlinkepisode.idEpisode JOIN tvshow ON  tvshowlinkepisode.idShow = tvshow.idShow ORDER BY episode.idEpisode DESC LIMIT 15)");
write(Response);
resetHeader = xbmcAPI("SetResponseFormat()");

%>
</channel>
</rss>
(This post was last modified: 2009-10-11 23:30 by MDPauley.)
find quote
ccMatrix Offline
Alaska Group
Posts: 470
Joined: Oct 2008
Post: #2
Cool idea. But this doesn't correctly show the latest items for me. I changed it to just get the very latest elements by adding ORDER BY x DESC:

Code:
Response = xbmcAPI("QueryVideoDatabase(select '<title>', C00, ' (', c07, ')', '</title>', '<description>',c01,'</description>' from movie ORDER BY idMovie DESC LIMIT 15)");

Code:
Response = xbmcAPI("QueryVideoDatabase(select '<title>', C00, ' (', c12, 'x', c13 ,')', '</title>', '<description>',c01,'</description>' from episode ORDER BY idEpisode DESC LIMIT 15)");
find quote
MDPauley Offline
Senior Member
Posts: 264
Joined: Mar 2004
Reputation: 0
Location: Centreville, Va
Post: #3
Shoot, you're right… I did this on my test box with only a few items in the library. I'll update the original post…
(This post was last modified: 2009-10-09 19:33 by MDPauley.)
find quote
craigey1 Offline
Junior Member
Posts: 40
Joined: Aug 2008
Reputation: 0
Post: #4
HaHa, I was just about to post the same thing!

Anyway I have modified the episode info slightly so that it now also shows the tv show as well.

Code:
Response = xbmcAPI("QueryVideoDatabase(SELECT '<title>',strTitle,': ', C00, ' (S', c12, 'E', c13 ,')', '</title>', '<description>',c01,'</description>' FROM episodeview ORDER BY idEpisode DESC Limit 15)");

Just wondering if there is anyway to get the tv show name in green? Also what can I do to add a leading zero to Season & Episode numbers where c12 & c13 < 10.

Thanks
find quote
stoli Offline
Skilled Skinner
Posts: 2,405
Joined: Nov 2008
Reputation: 30
Location: Florida
Post: #5
EDIT: Never mind - user error
(This post was last modified: 2009-10-09 23:59 by stoli.)
find quote
stoli Offline
Skilled Skinner
Posts: 2,405
Joined: Nov 2008
Reputation: 30
Location: Florida
Post: #6
Is there any way to have it pull the TV Show name as well as the episode name? I tried, but my limited sql skills got me nowhere fast.

Also, I do believe there is a typo in the asp - shouldn't "resetHeaser" be "resetHeader" ?

Thanks!
find quote
craigey1 Offline
Junior Member
Posts: 40
Joined: Aug 2008
Reputation: 0
Post: #7
stoli Wrote:Is there any way to have it pull the TV Show name as well as the episode name? I tried, but my limited sql skills got me nowhere fast.

Also, I do believe there is a typo in the asp - shouldn't "resetHeaser" be "resetHeader" ?

Thanks!

My post (just above your first post) does exactly that & yes that is a typo.
(This post was last modified: 2009-10-10 00:17 by craigey1.)
find quote
stoli Offline
Skilled Skinner
Posts: 2,405
Joined: Nov 2008
Reputation: 30
Location: Florida
Post: #8
craigey1 Wrote:My post (just above your first post) does exactly that & yes that is a typo.

Thanks - I evidently have failed reading comprehension today! Rolleyes

Changing the color depends on the skin you are using - in Aeon it's set in Includes_Colors.xml, can't speak for other skins... Here's the wiki with the control info.
(This post was last modified: 2009-10-10 00:45 by stoli.)
find quote
craigey1 Offline
Junior Member
Posts: 40
Joined: Aug 2008
Reputation: 0
Post: #9
so I presume I need to add a tag for the tv show name in order to get it to appear in the colour specified for that tag. Something like:

Code:
Response = xbmcAPI("QueryVideoDatabase(SELECT '<headlinecolor>',strTitle,': ','</headlinecolor>','<title>', C00, ' (S', c12, 'E', c13 ,')', '</title>', '<description>',c01,'</description>' FROM episodeview ORDER BY idEpisode DESC Limit 15)");

would I need to edit the setHeader = xbmcAPI("setresponseformat part of the code too as the above doesn't display any tv episodes.



I've been trying to add the leading zeros to season & episodes numbers, but sqlite doesnt seem to like the SQL I've been trying to use & the asp page doesn't seem to like the replace statements either.

Anyone got any ideas on these?
find quote
kizer Offline
Fan
Posts: 699
Joined: Jul 2008
Reputation: 0
Location: Seattle WA, US
Post: #10
Kinda cool, but like mentioned without the TV show name its hard to know what the episode name really is.
find quote
Post Reply