Native XBMC RSS feed for new shows and movies
#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>
Reply
#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)");
Reply
#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…
Reply
#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
Reply
#5
EDIT: Never mind - user error
-stoli-
Reply
#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!
-stoli-
Reply
#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.
Reply
#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.
-stoli-
Reply
#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?
Reply
#10
Kinda cool, but like mentioned without the TV show name its hard to know what the episode name really is.
Reply
#11
kizer Wrote:Kinda cool, but like mentioned without the TV show name its hard to know what the episode name really is.

Replace the TV statement with this...

Code:
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 idEpisode DESC LIMIT 15
Reply
#12
MPauley73 Wrote:Replace the TV statement with this...

Code:
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 idEpisode DESC LIMIT 15

I was trying to combine like you did and well got really confused. I tried what you posted and all I get is a blank line where the TV Episodes should be.

Code:
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 idEpisode DESC LIMIT 15)");
write(Response);
Reply
#13
kizer Wrote:I was trying to combine like you did and well got really confused. I tried what you posted and all I get is a blank line where the TV Episodes should be.

I created two separate asp files; one for movies and one for tv. This way when it scrolls movies are preceded by "New Movies" and tv shows by "New TV Shows". A little overkill, but hey...

You can download samples files here.

Here's the code for each that is working for me. Note that you will need to change the port to whatever you have set in the network settings.

Movies:
Code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>New Movies</title>
<link>http://localhost:80/rssmovies.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 20)");
write(Response);
resetHeader = xbmcAPI("SetResponseFormat()");
%>
</channel>
</rss>

TV Shows:

Code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>New TV Shows</title>
<link>http://localhost:80/rsstvshows.asp/</link>
<description>This is my rss 2 feed for newest xbmc tv shows</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>',strTitle,': ', C00, ' (S', c12, 'E', c13 ,')', '</title>', '<description>',c01,'</description>' FROM episodeview ORDER BY idEpisode DESC Limit 15)");
write(Response);
resetHeader = xbmcAPI("SetResponseFormat()");

%>
</channel>
</rss>

This is what your rssfeeds.xml should end up looking like (located in the \userdata folder):

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rssfeeds>
  <!-- RSS feeds. To have multiple feeds, just add a feed to the set. You can also have multiple sets.     !-->
  <!-- To use different sets in your skin, each must be called from skin with a unique id.                 !-->
  <set id="1">
       <feed updateinterval="30">http://localhost/rssmovies.asp</feed>
       <feed updateinterval="30">http://localhost/rsstvshows.asp</feed>
  </set>
</rssfeeds>
Note that you may have other feeds in there - you can leave them or remove them, it's up to you;

Thanks mpauley73 and craigey1!
-stoli-
Reply
#14
Now we are talking. Thanks for the TV episode code. Works great. Wink
Reply
#15
As relatively minor a thing this is, I think it's one of the best additions I've seen in a while. All the "Latest Added" mods look good, but get intrusive after a while.

Props to MPauley73 for coming up with this!!
-stoli-
Reply

Logout Mark Read Team Forum Stats Members Help
Native XBMC RSS feed for new shows and movies0