Ok, got some time to document some stuff from the script:
Attaching RSS to window (Like Home Window)
Here's some preview -
http://www.youtube.com/watch?v=i90MSaG93Qs
Running script is similiar to running Recently Added script:
Code:
<control type="button" id="8999">
<description>Run Recently added</description>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<label>-</label>
<font>-</font>
<onfocus>XBMC.RunScript(script.recentlyadded,limit=4)</onfocus>
[color=#FF0000][b]<onfocus>XBMC.RunScript(script.rssclient,guiless,feed=http://pipes.yahoo.com/pipes/pipe.run?_id=9c377c68a206d6ae8f2889db97f10084&_render=rss,limit=15)</onfocus>[/b][/color]
<onfocus>SetFocus(9000)</onfocus>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<visible>Skin.HasSetting(homepageHideRecentlyAdded)</visible>
</control>
I think parameters are pretty self-explanatory:
- guiless - don't create script's window
- feed=http://pipes.yahoo.com/pipes/pipe.run?_id=9c377c68a206d6ae8f2889db97f10084&_render=rss - specify source of RSS items (if not used, default feeds from rssfeeds.xml are used)
- limit=15 - setting item limit
Ok, script is reading feeds - now we need a way to show them, so let's create list for them (I won't write about using list - info is available in skinning manual) with static content:
Code:
<control type="list" id="XXX">
[...] <- list parameters, etc.
<content>
<item id="1">
<label>$INFO[Window.Property(RSS.1.Title)]</label>
<label2>$INFO[Window.Property(RSS.1.Desc)]</label2>
<onclick>SetProperty(RSS.Date,$INFO[Window.Property(RSS.1.Date)])</onclick>
<onclick>SetProperty(RSS.Channel,$INFO[Window.Property(RSS.1.Channel)])</onclick>
<onclick>SetProperty(RSS.Media,$INFO[Window.Property(RSS.1.Media)])</onclick>
<onclick>Control.SetFocus(30002)</onclick>
<icon>$INFO[Window.Property(RSS.1.Image)]</icon>
<thumb>-</thumb>
<visible>IntegerGreaterThan(Window.Property(RSS.count),1)</visible>
</item>
</content>
</control>
Explanation of
<onclick>Control.SetFocus(30002)</onclick>:
To display item's I've used Group Control:
Code:
<control type="group">
[...] - controls displaying item's content, date, channel, header, image
<control type="button" id="30002">
<onup>30004</onup>
<ondown>30050</ondown>
<onleft>9000</onleft>
<onright>9000</onright>
<onclick>Control.SetFocus(XXX)</onclick>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<visible>True</visible>
</control>
<control type="button" id="30004">
<onfocus>SetFocus(30002)</onfocus>
<onfocus>XBMC.PlayMedia($INFO[Window.Property(RSS.Media)])</onfocus>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<visible>!StringCompare(Window.Property(RSS.Media),none)</visible>
</control>
<control type="button" id="30004">
<onfocus>SetFocus(30050)</onfocus>
<posx>-20</posx>
<posy>-20</posy>
<width>1</width>
<height>1</height>
<visible>StringCompare(Window.Property(RSS.Media),none)</visible>
</control>
<visible>Control.HasFocus(30002)</visible>
</control>
And of course way to display item:
Code:
$INFO[Container(XXX).ListItem(0).Label] - displaying current's item header
$INFO[Container(XXX).ListItem(0).Label2] - displaying current's item text
$INFO[Container(XXX).ListItem.Icon] - current's item image url (empty if there is no image)
<visible>!StringCompare(Container(XXX).ListItem.Icon,)</visible> - checking if there is image for current item (control is visible if there is image)
$INFO[Window.Property(RSS.Date)] - displaying current's item date
$INFO[Window.Property(RSS.Channel)] - displaying current's item channel name
---
Playing media (just youtube now):
<label>Press 'UP' to play attached media</label>
<visible>!StringCompare(Window.Property(RSS.Media),none)</visible>
and
<onfocus>XBMC.PlayMedia($INFO[Window.Property(RSS.Media)])</onfocus>
---