i thought it would be nice to know the number of notifications, just like in the GMail inbox feed. as there no such info provided, i thought i'd just count the number of items in the feed. this means i fetch the whole feed and then use a few substitions:
the first four substitions eradicate linebreaks, tabs and other whitespace, the next one eradicates everything before the items start. then everything between tags gets removed and also everything after the items end.
what is left is a chain of
so let's replace with and with . to avoid a syntax error, let's replace the the last with .
just in case there are no items in the feed, nothing ( ) gets replaced with .
what is left is a chain of . use that as formula in a calc measure. done.
Code: Select all
[MeasureFacebookCountBase] Measure=Plugin Plugin=Plugins\WebParser.dll Url=#FacebookNotificationFeed# RegExp="(?siU)^(.*)$" StringIndex=1 RegExpSubstitute=1 Substitute="\r":"","\n":"","\t":"","\s":"","^(.*?)</webMaster>":"","<item>(.*?)</item>":"<item></item>","^(.*)</channel>(.*?)$":"\1","<item>":"1","</item>":"+","^(.+)$":"\10","^$":"0" Disabled=1 FinishAction=[!SetOption MeasureFacebookCountAll Formula "[MeasureFacebookCountBase]" "#CURRENTCONFIG#"][!UpdateMeasure MeasureFacebookCountAll][!DisableMeasure MeasureFacebookCountBase] [MeasureFacebookCountAll] Measure=Calc Formula=(0) DynamicVariables=1
warning: this is heavy on cpu use, depending on the length of the feed. that's why i have it disabled. i enable/update it with a when the regular Facebook feed reader measure is done. it gets disabled again when it did it's job.
so, i hope that gives you ideas on counting items in a feed. with a few modifications and the new dynamic webparser plugin, you can use variables either in the or in the substitutions to eliminate larger parts of the feed and only count new items for example. or items for today only. etc.