Page 1 of 3

Cobolt 2.7

Posted: July 17th, 2011, 10:05 am
by Seahorse
Shiny…

[ Direct Link ]
A full revision of my Cobolt theme featuring smaller, modular skins for ease of updating, new font, graphics, tool-tips and other flourishes. Some of the best parts are under the hood, and as always a big thank you to the people here who make this kind of stuff possible for the coding-challenged people like myself, and yes, I did, more than once:

Re: Cobolt 2.1

Posted: August 12th, 2011, 11:18 pm
by Seahorse
2.1 brings new bars, smaller meters, 3 new skins, marquee scrolling and more variants.

[ Direct Link ]

Re: Cobolt 2.2

Posted: September 1st, 2011, 6:34 pm
by Seahorse
2.2 changes the behaviour of temperature meters with a persistent read peak meter bar 'behind' the main green bar for easy visual reference. The Temp graphs have been replaced with load meters for the CPU cores. 4 Desktop search engine skins and 1 that toggle through them using middle mouse button. The usual amount of fixes & tweaks as well as the new style metatags added in 2.1r918.

[ Direct Link ]

Re: Cobolt 2.2

Posted: September 2nd, 2011, 1:58 am
by Shadyfoo
Looks very cool. Considering using it.

Re: Cobolt 2.2

Posted: September 2nd, 2011, 6:47 am
by Mordasius
You might like to use the following LUA script so that the BBC News and Guardian World News feeds are sorted to show the most recent entry at the top of the list in your FeedReader skin. I've cut out the 'bulleting' of new items so that you won't have to make any changes to the FeedReader.ini file.

Code: Select all

PROPERTIES = {
   FeedMeasureName = '';
   MultipleFeeds = 0;
   VariablePrefix = '';
   MinItems = 0;
   FinishAction = '';
}

-- When Rainmeter supports escape characters for bangs, use this function to escape quotes.
function ParseSpecialCharacters(sString)
   sString = string.gsub(sString, ' ', ' ')
   sString = string.gsub(sString, '\"', '')
   return sString
end

function Initialize()
   sFeedMeasureName = PROPERTIES.FeedMeasureName
   iMultipleFeeds = tonumber(PROPERTIES.MultipleFeeds)
   sVariablePrefix = PROPERTIES.VariablePrefix
   iMinItems = tonumber(PROPERTIES.MinItems)
   sFinishAction = PROPERTIES.FinishAction
   tFeeds = {}
   tTitles = {}
   tLinks = {}
   tDates = {}
   tmText = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
   tmNum = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}
end

function Update()
   -----------------------------------------------------------------------
   -- INPUT FEEDS
   
   if iMultipleFeeds == 1 then
      iNumberOfFeeds = tonumber(SKIN:GetVariable(sVariablePrefix..'NumberOfFeeds'))
      for i = 1, iNumberOfFeeds do
         tFeeds[i] = SKIN:GetVariable(sVariablePrefix..'FeedMeasureName'..i)
      end
      iCurrentFeed = tonumber(SKIN:GetVariable(sVariablePrefix..'CurrentFeed'))
      msRaw = SKIN:GetMeasure(tFeeds[iCurrentFeed])
   else
      msRaw = SKIN:GetMeasure(sFeedMeasureName)
   end
   sRaw = msRaw:GetStringValue()

   -----------------------------------------------------------------------
   -- DETERMINE FEED FORMAT AND CONTENTS
   
   sPatternFeedTitle = '.-<title.->(.-)</title>'
   sPatternItemTitle = '.-<title.->(.-)</title>'
   if string.match(sRaw, 'xmlns:gCal') then
      sRawCounted, iNumberOfItems = string.gsub(sRaw, '<entry', "")
      sPatternFeedLink = '.-<link.-rel=.-alternate.-href=\'(.-)\''
      sPatternItem = '<entry.-</entry>'
      sPatternItemLink = '.-<link.-href=\'(.-)\''
      sPatternItemDate = '.-When: (.-)<'
   elseif string.match(sRaw, '<subtitle>rememberthemilk.com</subtitle>') then
      sRawCounted, iNumberOfItems = string.gsub(sRaw, '<entry', "")
      sPatternFeedLink = '.-<link.-rel=.-alternate.-href="(.-)"'
      sPatternItem = '<entry.-</entry>'
      sPatternItemLink = '.-<link.-href="(.-)"'
      sPatternItemDate = '<span class="rtm_due_value">(.-)</span>'
   elseif string.match(sRaw, '<rss.-version=".-".->') then
      sRawCounted, iNumberOfItems = string.gsub(sRaw, '<item', "")
      sPatternFeedLink = '.-<link.->(.-)</link>'
      sPatternItem = '<item.-</item>'
      sPatternItemLink = '.-<link.->(.-)</link>'
      sPatternItemDesc = '.-<description.->(.-)</description>'
      sPatternItemDate = '.-<pubDate.->(.-)</pubDate>'	
   else
      sRawCounted, iNumberOfItems = string.gsub(sRaw, '<entry', "")
      sPatternFeedLink = '.-<link.-href="(.-)"'
      sPatternItem = '<entry.-</entry>'
      sPatternItemLink = '.-<link.-href="(.-)"'
      sPatternItemDesc = '.-<summary.->(.-)</summary>'
      sPatternItemDate = '.-<updated.->(.-)</updated>'
   end
   
   -----------------------------------------------------------------------
   -- ERRORS
   
   sFeedTitle, sFeedLink = string.match(sRaw, sPatternFeedTitle..sPatternFeedLink)
   if not sFeedTitle then
      FeedError('Error', '', 'Connection or matching error.')
      return 'Error: matching.'
   end
   
   sFeedTitle = ParseSpecialCharacters(sFeedTitle)
   sFeedLink = ParseSpecialCharacters(sFeedLink)
   
   if iNumberOfItems == 0 then
      SKIN:Bang('!SetVariable "'..sVariablePrefix..'NumberOfItems" "0"')
      SKIN:Bang('!SetVariable "'..sVariablePrefix..'FeedTitle" "'..sFeedTitle..'"')
      SKIN:Bang('!SetVariable "'..sVariablePrefix..'FeedLink" "'..sFeedLink..'"')
      FeedError(sFeedTitle, '', 'Empty.')
      return 'Error: empty feed.'
   end
   
   -----------------------------------------------------------------------
   -- CREATE DATABASE
   
   local tItems = {}
   iInit = 0
   for i = 1, iNumberOfItems do
      iItemStart, iItemEnd = string.find(sRaw, sPatternItem, iInit)
      sItem = string.sub(sRaw, iItemStart, iItemEnd)
      tTitles[i] = string.match(sItem, sPatternItemTitle)
      tTitles[i] = ParseSpecialCharacters(tTitles[i])
      tLinks[i] = string.match(sItem, sPatternItemLink)
      tLinks[i] = ParseSpecialCharacters(tLinks[i])
      tDates[i] = string.match(sItem, sPatternItemDate)
      tDates[i] = ParseSpecialCharacters(tDates[i])	  
      for j = 1, 12 do tDates[i]  =  string.gsub(tDates[i], tmText[j] , tmNum[j] ) end     
      tDates[i]  =  string.sub(tDates[i],  12, 15)..string.sub(tDates[i],  9, 10)..string.sub(tDates[i],6, 7)..string.sub(tDates[i],17, 18)..string.sub(tDates[i],20,21)..string.sub(tDates[i],23,24)	 
      iInit = iItemEnd + 1	  
      table.insert(tItems, { iTitle = tTitles[i], iLinks = tLinks[i], iPub = tDates[i] } )
   end
   
   -----------------------------------------------------------------------
   -- SORT DATABASE BY PUB DATE -- needed for BBC and Guardian feeds
               
   tPubDate_idx = {}
   for k, v in pairs(tItems) do
      tPubDate_idx[ v.iPub ] = k
   end         
   tPubDate_Array = {}     
   for k, v in pairs(tPubDate_idx) do
      table.insert(tPubDate_Array, k)
   end
   table.sort(tPubDate_Array, function(a,b) return a > b end)
   
   -----------------------------------------------------------------------
   -- OUTPUT

   SKIN:Bang('!SetVariable "'..sVariablePrefix..'NumberOfItems" "'..iNumberOfItems..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "Text" "'..sFeedTitle..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "LeftMouseUpAction" "'..sFeedLink..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "ToolTipText" "'..sFeedLink..'"')
   
	for i, v in ipairs(tPubDate_Array) do
		iRecnum = tPubDate_idx[v]
		Record = tItems[iRecnum]       
    SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedItem'..i..'" "Text" "'..Record.iTitle..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedItem'..i..'" "LeftMouseUpAction" "'..Record.iLinks..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedItem'..i..'" "ToolTipText" "'..Record.iLinks..'"')
	end


   -----------------------------------------------------------------------
   -- FINISH ACTION
   
   if sFinishAction ~= '' then
      SKIN:Bang(sFinishAction)
   end
   
   return 'Success'
end

---------------------------------------------------------------------
-- SWITCHERS

function TimedUpdate(a)
   tPastUpdate[a] = tPresentUpdate[a]
   Update()
end

function SwitchToNext()
   iCurrentFeed = iCurrentFeed % iNumberOfFeeds + 1
   SKIN:Bang('!SetVariable "'..sVariablePrefix..'CurrentFeed" "'..iCurrentFeed..'"')
   Update()
end

function SwitchToPrevious()
   iCurrentFeed = iCurrentFeed - 1 + (iCurrentFeed == 1 and iNumberOfFeeds or 0)
   SKIN:Bang('!SetVariable "'..sVariablePrefix..'CurrentFeed" "'..iCurrentFeed..'"')
   Update()
end

function FeedError(sErrorName, sErrorLink, sErrorDesc)
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "Text" "'..sErrorName..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "LeftMouseUpAction" "'..sErrorLink..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedTitle" "ToolTipText" "'..sErrorLink..'"')
	SKIN:Bang('!SetOption "'..sVariablePrefix..'FeedItem1" "Text" "'..sErrorDesc..'"')
end

Re: Cobolt 2.2

Posted: September 2nd, 2011, 9:47 am
by Seahorse
Shadyfoo wrote:Looks very cool. Considering using it.
Thank you, the look has been harder to achieve by someone as bad at image editing as myself :sly:
Mordasius wrote:You might like to use the following LUA script so that the BBC News and Guardian World News feeds are sorted to show the most recent entry at the top of the list in your FeedReader skin. I've cut out the 'bulleting' of new items so that you won't have to make any changes to the FeedReader.ini file.
Thank you, I will test over the weekend, I'm on another business trip today, so just doing a sneaky read of the forums :twisted:
I did initially use the BBC Feed reader for that reason, however the ease of use of the Universal option meant losing that choice... :thumbup:

Re: Cobolt 2.2

Posted: September 2nd, 2011, 2:09 pm
by Kaelri
I'll likely add the sorting option to the next version of the universal script.

Re: Cobolt 2.2

Posted: September 2nd, 2011, 6:28 pm
by Seahorse
Result! :D

Re: Cobolt 2.2

Posted: September 3rd, 2011, 2:27 am
by Mordasius
Kaelri wrote:I'll likely add the sorting option to the next version of the universal script.
Good idea, but do watch out for odd feeds like the Rainmeter Forums which have dates in a different format ( 2011-09-02T09:10:45+08:00 ) to the BBC and Guardian News feeds ( Fri, 02 Sep 2011 19:11:39 GMT ). This is really annoying because the Rainmeter Forums are already sorted chronologicaly but the LUA script spews out errors unless you use a separate set of string.subs before sorting the <published> dates. I only do it so that the script can put the '•' bullet marks to show which topics are new as per the method you suggested over on [Proof of Concept] Universal Feed Reader (here)

Re: Cobolt 2.2

Posted: September 6th, 2011, 7:12 am
by BraytonBuddy
curious, Is there a way to make the lyrics skin into a scroll box? Instead of getting longer for more lyrics?