It is currently July 7th, 2022, 4:01 pm

Reader

Discuss the use of Lua in Script measures.
User avatar
Benjamin Linus
Posts: 163
Joined: July 12th, 2009, 4:05 pm
Location: The Island

Re: [Proof of Concept] Universal Feed Reader

Post by Benjamin Linus »

Amazing stuff men :bow:
Image
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: [Proof of Concept] Universal Feed Reader

Post by Jkon »

Brilliance,pure brilliance.Puts an end to a nuisance that was a thorn in everyone's side.Not to distract from your fantastic work but what is this that it is that I see lurking in your code, MouseOverAction=!SetOption "#CURRENTSECTION#" FontColor 128,192,255,224.
What else have you guys been keeping under your hats,and how soon shall we be seeing this little gem implemented?
Image
User avatar
jsmorley
Developer
Posts: 22527
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Proof of Concept] Universal Feed Reader

Post by jsmorley »

Jkon wrote:Brilliance,pure brilliance.Puts an end to a nuisance that was a thorn in everyone's side.Not to distract from your fantastic work but what is this that it is that I see lurking in your code, MouseOverAction=!SetOption "#CURRENTSECTION#" FontColor 128,192,255,224.
What else have you guys been keeping under your hats,and how soon shall we be seeing this little gem implemented?
We could tell you, but then we would have to kill you...

:-)

Don't be out of pocket this Sunday... Trust me....
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: [Proof of Concept] Universal Feed Reader

Post by Jkon »

Never has your avatar suited you more. :sly:
Image
User avatar
jsmorley
Developer
Posts: 22527
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Proof of Concept] Universal Feed Reader

Post by jsmorley »

Jkon wrote:Never has your avatar suited you more. :sly:
I find I don't get taken seriously when I use my other one...

Image
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: [Proof of Concept] Universal Feed Reader

Post by Jkon »

thanks.now I have to spend the next 20 minutes cleaning up the mouth full of coffee that just blew out me nose.
Image
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Proof of Concept] Universal Feed Reader

Post by Kaelri »

Updated! See first post for new script and example skin.



New features:
  • Added support for Google Calendar (basic) and Remember The Milk list feeds. As with standard RSS and Atom, the user does not need to specify the feed format - the script determines it automatically from the contents and uses the appropriate parsing patterns.
  • Added MinItems setting on the script measure, to indicate the minimum number of items requested by the skin. If the feed returns fewer items than requested, the script will set the remaining variables as blank.
  • Added an optional FinishAction to the script measure, which works just like WebParser's. The FinishAction will be executed every time Update() is called.
  • Added functions to switch the display to the next or previous feed in the cycle. The script automatically loops back around from the beginning or end of the list, according to the NumberOfFeeds variable set by the user. Usage is as such:

    Code: Select all

    LeftMouseUpAction=!CommandMeasure "MeasureLuaScript" "SwitchToPrevious()"
    LeftMouseUpAction=!CommandMeasure "MeasureLuaScript" "SwitchToNext()"
    Try the new arrow buttons in the demo skin. They're enormously fun to play with.
  • Script now returns proper feedback information if it doesn't get a valid feed from Rainmeter, or if the feed contains no items. Each case uses a generic "FeedError" function, which could also just as easily be called by the skin with author-defined name and description parameters.
  • Added return variables for each item's publish date. Because not all feeds provide this information, the script checks each item to see if a pubdate tag is present; if it's not, it sets the item's date variable as blank. A similar method will be used soon to get author and summary info.
  • In honor of today's new features, I've included a variant that demonstrates the use of !SetOption. :)

    Using this method cleans up the code considerably. This, for example, is literally what one of the feed item meters looks like now:

    Code: Select all

    [FeedItem1]
    Meter=STRING
    MeterStyle=StyleText
    And that's it. Seriously. The script sets the Text, LeftMouseUpAction and ToolTipText for each meter as appropriate. The skin hardly has to provide anything - not even dynamic variables. In addition, I've set mouseover actions in the [StyleText] section:

    Code: Select all

    MouseOverAction=!Execute [!SetOption "#CURRENTSECTION#" FontColor 128,192,255,224][!Update]
    MouseLeaveAction=!Execute [!SetOption "#CURRENTSECTION#" FontColor 255,255,255,217][!Update]
    Again, no dynamic variables or Calc measures to determine the mouseover state. Just direct !SetOption actions. And using the "#CURRENTSECTION#" variable allows you to set such keys in a style section and have it apply to each dependent meter or measure. This stuff is a serious game-changer.
After a few more tweaks to this script, I'm going to start converting Enigma's Reader skins to make use of them. Should hit the market sometime this week. :)
User avatar
Benjamin Linus
Posts: 163
Joined: July 12th, 2009, 4:05 pm
Location: The Island

Re: [Proof of Concept] Universal Feed Reader

Post by Benjamin Linus »

:cheer: It keeps getting better!!

Pulling Google Reader atom feeds with ease :rosegift:
How to add your own custom feed titles as Google Reader's are extremely long ?
Image
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [Proof of Concept] Universal Feed Reader

Post by Kaelri »

Can you give me an example? Is it just like a prefix that you could remove, or do you need to change it to something else entirely?
User avatar
Benjamin Linus
Posts: 163
Joined: July 12th, 2009, 4:05 pm
Location: The Island

Re: [Proof of Concept] Universal Feed Reader

Post by Benjamin Linus »

Kaelri wrote:Can you give me an example? Is it just like a prefix that you could remove, or do you need to change it to something else entirely?
<title>"TV News" via Greg in Google Reader</title> This is the data it pulls from Google Reader as the feed title.
I just need the title of feed to be simply i.e. TV News
TIA :D

Title needs to be abbreviated or otherwise looks a little silly :?
Image