It is currently December 14th, 2018, 8:21 pm

Google feed "For you"

General topics related to Rainmeter.
User avatar
kyriakos876
Posts: 887
Joined: January 30th, 2017, 2:01 am
Location: Greece

Google feed "For you"

kyriakos876 » November 1st, 2018, 1:46 pm

Hello,
Any chance that there's an RSS URL for google's feed where you put your ID and PW in the link and get news related to you? Kinda like "google now" in android phones.... Did some research but didn't find something.

-Thanks in advance!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3053
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Google feed "For you"

eclectic-tech » November 1st, 2018, 11:18 pm

kyriakos876 wrote:
November 1st, 2018, 1:46 pm
Hello,
Any chance that there's an RSS URL for google's feed where you put your ID and PW in the link and get news related to you? Kinda like "google now" in android phones.... Did some research but didn't find something.

-Thanks in advance!
I was able to work out a way to parse Google Alerts that are set up to be delivered as RSS.

Create an alert in your Google account. https://www.google.com/alerts
When you set the options for the alert, set 'Deliver to' as RSS
Then from your list of alerts, right-click the RSS icon and select 'Copy link location'
This will be a URL in the form of 'https://www.google.com/alerts/feeds/{userid}/{alertid}'
Use that as the URL in Webparser or create a #URL# variable with that value
The RegExp to obtain Title and Link is: <entry>.*<title.*>(.*)<.*url=(.*)&.*</entry>.*
I set that as a variable #Storysect# and repeat it 10 times to obtain the data:

Code: Select all

[RSS]
Measure=WebParser
Url=#URL#
; Parse multiple sections the neat way using a variable in the RegExp that defines the repeated captures
RegExp=(?siU)#storysect##storysect##storysect##storysect##storysect##storysect##storysect##storysect##storysect##storysect#
The issue I had was determining how Google coded the link :x ... and needed a substitution to for embedded HTML code in the Title child measures: Substitute="<b>":"","</b>":"","&#39;":"'"
I am sure there are other HTML characters that I haven't seen yet that can be added to the substitution.

With a slight modification to the #storysect# experession, you can get the 'publish date/time' and 'content' info.
Google Alerts let you customize the content based on keywords.

I sent you a PM