This single flow reads the google RSS feed and retrieves the news headlines and reads it out aloud.it uses the split function to do the dirty work.I tried using regular expression but it gave me only one single news headline. I'll be grateful if someone could help me with the regular expression part.
Thanks
http://automagic4android.com/flow.php?i ... 51b3a5fa67
google news reader
Moderator: Martin
Re: google news reader
Hi,
You could use XPath to extract the titles from an RSS feed. XPath is quite limited in Automagic, but might work better than regular expressions in this case since there are multiple different elements containing a title element.
The first XPath expression counts the number of item elements. The second XPath expression extracts the n-th title (within an item) and adds the title to a list.
Regards,
Martin
You could use XPath to extract the titles from an RSS feed. XPath is quite limited in Automagic, but might work better than regular expressions in this case since there are multiple different elements containing a title element.
Code: Select all
headlines=newList();
count=evaluateXPathAsString(response, "count(//item)");
for (i in [1 to count])
{
title=evaluateXPathAsString(response, "//item[{i}]/title");
addElement(headlines, title);
}
Regards,
Martin
Re: google news reader
Thanks a lot Martin, xpath works like a charm. I didn't know about this. Now I think its worth that I switched from tasker to automagic.