RSSReader 1.0
About :
RSSReader is a module, intended for reading RSS news backend, which is usually available for e107 engine sites and some others.
Hmmmm... No, actually it isn't complete module, because it cannot show text! :)
It needs another module that exports text engine functions: Label, xLabel or xLabelLight
System Requirements:
There are no any specific software or hardware limitations. I hope :)
Usage :
Eash RSS-request must be captioned in the next manner:
*RSSimport [name]
All request's settings would have the following form
[name][option] [value]
for example:
*RSSImport MySiteNews
MySiteNewsURL http://www.mysite.ru/news/backend/rss.xml
Sample config using xLabelLight 2.8.3:
;===============================================
; RSS news feeds (RSSReader v1.0)
;-----------------------------------------------
*RSSimport RSS
RSSURL http://www.shellfront.org/shellfront.xml
RSSItemCount 10
RSSUpdateInterval 100
RSSInfoString ^@Description^\n(^@Link^)
RSSItemString ^@Title^\n^@Description^
RSSItemSeparator \n
RSSEnabled true
RSSInfoLabel RSSLabelTitle
RSSItemLabel RSSLabelItems
RSSOnUpdated !Execute [!LabelShow RSSLabelTitle][!LabelShow RSSLabelItems]
;RSSOnFailure !alert "RSS Update Failed"
;======================
*Label RSSLabelTitle
;----------------------
RSSLabelTitleX -300
RSSLabelTitleY 50
RSSLabelTitleWidth 224
RSSLabelTitleHeight 84
RSSLabelTitleText "Here would be the title"
RSSLabelTitleImage rss_head.png
RSSLabelTitleImageMode stretch
RSSLabelTitleStartHidden
;======================
*Label RSSLabelItems
;----------------------
RSSLabelItemsX -300
RSSLabelItemsY 135
RSSLabelItemsWidth 224
RSSLabelItemsHeight 300
RSSLabelItemsText "Here would be the dragons"
RSSLabelItemsImage rss_body.png
RSSLabelItemsImageMode stretch
RSSLabelItemsImageTopEdge 3
RSSLabelItemsImageBottomEdge 3
RSSLabelItemsLeftBorder 5
RSSLabelItemsRightBorder 5
RSSLabelItemsTopBorder 5
RSSLabelItemsBottomBorder 5
RSSLabelItemsAutoLineBreak true
RSSLabelItemsAlign left
RSSLabelItemsVertAlign top
RSSLabelItemsFontHeight 13
RSSLabelItemsStartHidden
Configuration:
NOTE: Doublequotes must die!
RSS request options:
(request name)URL [RSS-file]
URL for the XML file containing news.
By default: http://www.shellfront.org/shellfront.xml
(request name)Enabled [false/true]
If enabled, news would be automatically updated. Else you need to use !RSSUpdate !bang manually
By default: true
(request name)UpdateInterval [number]
Time interval between updating (in seconds!).
By default : 600 (10 minutes)
(request name)ItemCount [number]
Max news items number that would be read from the RSS-file
By default: 10
(request name)InfoString [pattern]
This pattern would be used for generating a news header. You can use both regular text and AtVars
By default: ^@Title^\n(^@Link^)\n^@Description^
(request name)ItemString [pattern]
This pattern used for formatting news items. You need to use AtVars here
By default: ^@Title^ (^@Link^)
(request name)ItemSeparator [òåêñò]
Text that would separate news items text.
By default: \n
(request name)OnUpdated [action]
Action that would be called after successfull downloading and parsing of the RSS-file.
By default: !none
(request name)OnFailure [action]
Action performed if download failed or file has incorrect structure.
By default: !none
(request name)InfoLabel [text container name]
If set and is not empty, container would be used for displaying text, formatted using InfoString.
By default: empty string
(request name)ItemLabel [text container name]
If set and is not empty, this container would be used for displaying text, formed from ItemCount number news item strings that are generated using ItemString pattern and separated by ItemSeparator.
By default: empty string
!Bangs:
First parameter of each !bang is RSS request name.
For example, to update news described by MySiteNews request, you need to execute
!RSSUpdate MySiteNews
Full list of the exported !bangs:
!RSSUpdate (request name)
Update news.
!RSSEnable (request name)
Enable automatic updates.
!RSSDisable (request name)
Disable automatic updates.
!RSSToggle (request name)
Disable if enabled, enable if disabled :)
!RSSSetURL (request name) [URL]
Change RSS-file URL.
!RSSSetCount (request name) [number]
Change number of displaying news.
!RSSSetInfoString (request name) [pattern]
Change header pattern.
!RSSSetItemString (request name) [pattern]
Change news item pattern.
!RSSSetItemSeparator (request name) [text]
Change separator text.
!RSSSetUpdateInterval (request name) [seconds]
Change update interval.
AtVars:
You can use the following AtVars (escape-sequencies) in the patterns:
^@Title^
News caption / RSS-channel title
^@Link^
Basic news/channel link
^@Description^
Full news item text / channel description
Exported eVars:
After updating RSSReader exports the following eVars:
(request name)_Title
RSS-channel title
(request name)_Link
Basic channel link
(request name)_Description
Channel description
(request name)_Info
Channel header, formed using (request name)InfoString
(request name)_Items
News text generated using (request name)ItemString and (request name)ItemSeparator
(request name)_Item1, (request name)_Item2, (request name)_Item3 è ò.ä.
News items, formatted using (request name)ItemString
(request name)_Item1_Title, (request name)_Item1_Link, (request name)_Item1_Description,
(request name)_Item2_Title, (request name)_Item2_Link è ò.ä.
Sole news item components
Originally usage of this eVars, OnUpdated action and !ParseEvars !bang was emphasised during development, - I apologized that it is the most flexible way of configuring. For exmaple, user can set 10 labels, set their text on OnUpdated to %#Item[number]Title$#, and change OnClick action to %#Item[number]Link%#. But the greatest trouble is that LiteStep + Text Processing = Hell. If ^@Title^ contain doublequotes, text would be cut in the middle... To use single quotes in the beginning and in the end? But if ^@Title^ contains single quote?
So, I'm really troubled... May be you can do more than me? ;)
Changelog:
Version 1.0, 04.04.2004
Child opened his eyes, looked at our strange world and started to cry...
Author:
Handle :
Sergey Gagarin a.k.a. Seg@
E-Mail :
inform-sega@freemail.ru
Web :
http://www.litestep.bip.ru/
ICQ : 162261148
IRC : #litestep @ freenode.net