It is currently April 28th, 2024, 2:03 pm
Google news
-
- Posts: 3
- Joined: January 7th, 2013, 6:05 am
Google news
Hey, I'm wondering how I'd get google news feeds with rainmeter? I'd like one that shows me the top stories of the day, and also one that allows me to customize a search term so that I can search, say, for "apple" and I'd get apple news. Thanks.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Google news
There are tons of RSS feed skins that you can modify to use the URL:
Url=http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss
To get the latest headlines from Google News.
As to doing searches, that is more complicated. It would take a combination of an InputText plugin measure to capture your input, along with some Lua scripting to parse the feed and return only the items that match the search. It is doable, but would be a fair to middling project...
Url=http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss
To get the latest headlines from Google News.
As to doing searches, that is more complicated. It would take a combination of an InputText plugin measure to capture your input, along with some Lua scripting to parse the feed and return only the items that match the search. It is doable, but would be a fair to middling project...
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Google news
you make this just like any other news skin.
you'll find the address of the feed at the bottom of the site (depends on your locale).
for example for trending news:
for example for news on Apple:
now you just need to replace the "apple" part with a user defined variable:
you'll find the address of the feed at the bottom of the site (depends on your locale).
for example for trending news:
Code: Select all
http://news.google.de/news?pz=1&cf=all&ned=de&hl=de&output=rss
Code: Select all
https://news.google.at/news/feeds?hl=de&gl=at&q=apple&um=1&ie=UTF-8&output=rss
Code: Select all
https://news.google.at/news/feeds?hl=de&gl=at&q=#NewsSearch#&um=1&ie=UTF-8&output=rss
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Google news
lua is not required, as you can see in the feed addresses in my post above.jsmorley wrote: As to doing searches, that is more complicated. It would take a combination of an InputText plugin measure to capture your input, along with some Lua scripting to parse the feed and return only the items that match the search. It is doable, but would be a fair to middling project...
i made a skin that does searches (for the news it uses Faroo, but might include Google News in the next version). it's available here: http://customize.org/rainmeter/skins/91081
but be warned, it's not that easy to understand, and even harder to explain. (i'm talking to the average user here)
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Google news
The only issue I would have with not using Lua is that if your search term returns no items, or less items than you have coded for in the child measures and associated meters, your skin might behave quite strangely, return a lot of errors in the log, and display a lot of empty meters. With Lua you can get a count of returned items, and then hide or show meters as needed, along with making the background of the skin size to fit the amount of returned items.moshi wrote: lua is not required, as you can see in the feed addresses in my post above.
i made a skin that does searches (for the news it uses Faroo, but might include Google News in the next version). it's available here: http://customize.org/rainmeter/skins/91081
but be warned, it's not that easy to understand, and even harder to explain.
However, your approach at at high level is certainly easier, and might well work well enough for most needs.
Here is a skin I did that does something like this for the site "Breaking News", that allows highlighting "keywords" in the feed, using an InputText measure and some Lua. It is also fairly complicated, but could reasonably easily be modified to do Google News instead. This doesn't "restrict" the items to ones matching the search, but displays the entire feed (well, the first 10 items in this case) while using color to highlight both "new" items and ones matching your search.
[ Direct Link ]
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Google news
That is the beauty of Rainmeter... There are always at least 10 ways to get where you need to go.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Google news
it behaves quite well. default is five items:jsmorley wrote:The only issue I would have with not using Lua is that if your search term returns no items, or less items than you have coded for in the child measures and associated meters, your skin might behave quite strangely, return a lot of errors in the log, and display a lot of empty meters. With Lua you can get a count of returned items, and then hide or show meters as needed, along with making the background of the skin size to fit the amount of returned items.
the reason it behaves are (of course) look-ahead regular expressions. and the use of invisible "dummy" meters.
Code: Select all
[MeterDummy1]
Meter=STRING
Text="[MeasureNews1Title]"
X=37
Y=(([EviBackTop2:Y])+41)
FontColor=ffffff00
SolidColor=ff000000
FontSize=11
FontFace=Source Sans Pro
StringStyle=NORMAL
Antialias=1
Hidden=1
Group=EviFull2
DynamicVariables=1
StringAlign=RIGHT
[News1Kwic]
Meter=STRING
MeasureName=MeasureNews1Kwic
Text="%1"
X=42
Y=(([News1Back:Y])+65)
W=246
H=((([MeterDummy1:H])/20)*33)
ClipString=1
FontColor=50506e
FontSize=((([MeterDummy1:H])/20)*7)
FontFace=Cambria
StringStyle=NORMAL
Antialias=1
Hidden=1
Group=EviFull2
DynamicVariables=1
SolidColor=ffffff00
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Google news
two more things to consider:
the feeds have a limited number of entries (lets say 50, i did not count).
so if you parse the main feed: for "Apple" and there is no news on it among the first 50 entries you are out of luck.
this feed: on the other hand displays the first 50 news related to Apple.
and the Google api probably does a much better job searching for multiple keywords than a lua script could.
the feeds have a limited number of entries (lets say 50, i did not count).
so if you parse the main feed:
Code: Select all
http://news.google.de/news?pz=1&cf=all&ned=de&hl=de&output=rss
this feed:
Code: Select all
https://news.google.at/news/feeds?hl=de&gl=at&q=apple&um=1&ie=UTF-8&output=rss
and the Google api probably does a much better job searching for multiple keywords than a lua script could.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Google news
That is true.moshi wrote:two more things to consider:
the feeds have a limited number of entries (lets say 50, i did not count).
so if you parse the main feed:for "Apple" and there is no news on it among the first 50 entries you are out of luck.Code: Select all
http://news.google.de/news?pz=1&cf=all&ned=de&hl=de&output=rss
this feed:on the other hand displays the first 50 news related to Apple.Code: Select all
https://news.google.at/news/feeds?hl=de&gl=at&q=apple&um=1&ie=UTF-8&output=rss
and the Google api probably does a much better job searching for multiple keywords than a lua script could.
-
- Posts: 3
- Joined: January 7th, 2013, 6:05 am
Re: Google news
I tried putting into the RSS feed in omnimo and when I click the appropriate button it doesn't open it up as if it doesn't work. In other words, the link isn't working :P
Code: Select all
http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss