Link to home
Start Free TrialLog in
Avatar of PTRUSCOTT
PTRUSCOTT

asked on

How do I insert a Google News Feed on my Blog with a very complex query

Dear Experts,
I want to insert a Google News feed on my Wordpress blog with a very specialized query filter.

The web page is about a policy proposal called "basic income". If I submit the following search on Google News the correct results are returned:
"citizen's income" OR ("basic income" universal)

I am currently using the WordPress plugin called "Google News" but it would not accept such a complex filter expression.

I thought I could get a feed from newsfeedmaker.com but this did not return any results when I limited "basic income" to stories with the word "universal".

I think I ought to be able to do this with some kind of HTML building code that builds a piece of HTML around my query string.  Where can I find this?
Sincerely,
Philip
Avatar of BMilneSLO
BMilneSLO
Flag of United States of America image

Hey Philip,

Thanks for using Experts Exchange to address your technology question. You should still be able to use Wordpress' tools to add the RSS feed to your site. Just use this feed:

http://news.google.com/news?pz=1&ned=us&hl=en&q=%22citizen%27s+income%22+OR+%22basic+income%22&output=rss

I got that specific RSS feed by searching Google News for "citizen's income" OR "basic income" and then clicking the RSS link on the bottom of the lef-hand nav.

To install on your blog, log in to WordPress, go to add a widget, and click on add RSS. That'll add an RSS widget to your sidebar. All you have to do from there is click edit RSS feed and enter the above RSS feed in the url field. It will also allow you to give the feed your own title.

Hope that helps solve your technology problem. Thanks again for using Experts Exchange.
One more thing. If the content from the RSS feeds doesn't show up on your site, be sure check the "Display item content" button on the RSS feed widget you're installing in your sidebar? You should also be able to show the author and date of the posts if you like.
Avatar of PTRUSCOTT
PTRUSCOTT

ASKER

Dear BMilneSLO,
That does not fully solve my problem because I want to have different news feeds on different pages. If I insert it into a sidebar widget it will be the same on all pages.
Best Wishes,
Philip T.
OK. Well, the feed url should still work:

http://news.google.com/news?pz=1&ned=us&hl=en&q=%22citizen%27s+income%22+OR+%22basic+income%22&output=rss

Just need to pick an RSS service or generate the code you want to add to the specific page.

I tried the above url with RSSFeedReader.com and it produced a PHP or a JaveScript code ready to embed on your website.

You'd have to tweak the settings so that the formating matches your own site.

The PHP version is recommended for SEO purposes.
Dear BMilneSLO,
I was able to produce a nicely formatted news feed using your method but I was not able to do a complex query using Google News.  I tried to follow your steps as follows:
1. Went to Google News advanced search
2. I searched for the exact phrase "basic income", with at least "universal" or "unconditional", I excluded articles containing the word "quarter".
3. I tried two different ways of transferring this to RSSFeedReader I tried just copying the address from Google News and then I clicked the RSS button at the bottom left of the Google News Page. This produced the following string in the address bar on the next page.
***************************************************************************
http://news.google.com.ph/news?pz=1&ned=en_ph&hl=en&as_scoring=r&as_maxm=3&q=%22basic+income%22+universal+OR+unconditional+-quarter&as_drrb=q&as_mind=20&as_minm=2&as_maxd=22&output=rss
***************************************************************************
This produced the relevant articles in Google News but when I put it into RSSFeedReader I got nothing.  When I copy your string above I do get a set of articles but it includes the financial company reports which are not relevant.  Your string below looks like I could edit it directly if I knew the syntax.  Is there a syntax guide you could recommend?
Best Wishes,
Philip

*****************************************************************************************************
http://news.google.com/news?pz=1&ned=us&hl=en&q=%22citizen%27s+income%22+OR+%22basic+income%22&output=rss
*****************************************************************************************************
That sounds like what I did. I would also sort by date, so the latest articles show up rather than the most relevant ones.

I got the above link by searching "citizen's income" OR "basic income" in the standard Google news search bar.

Does this work?

http://news.google.com/news?pz=1&ned=us&hl=en&as_maxm=3&q=%22basic+income%22+-%22quarter%22&as_drrb=q&as_mind=21&as_minm=2&as_maxd=23&scoring=n&output=rss

I just tried advanced search in google news, searching with all of the words "basic income," sort by date (newest first), and without the words "quarter"

Then I bookmarked the RSS, went into the properties and copied the feed url.

You might try the yahoo url above as well.
Dear BMilneSLO,
Your solution works in the sense that I can see an RSS feed.  However it does not remove the articles that mention the word "quarter" so it includes a lot of company financial reports that do not relate to my topic.  

If I follow the steps you give, I get a correct selection of news stores in Google News but when I copy the string from Bookmarks --> Properties ino RSS FeedReader then I get zero stories.
Sincerely,
Phil
ASKER CERTIFIED SOLUTION
Avatar of BMilneSLO
BMilneSLO
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial