Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2020, 09:11 AM   #1
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
New Recipe - google news - i wonder why it isn't here

Hi again,
as i say above, i wonder why there is no google news feed recipe! Everyone 'googles' information!
So i wrote a recipe which everyone could modify to his needs

I upload two samples here:

First one is - regards to Kovid Goyal - a google news feed with indian content.

It's THIS one.
Attached Files
File Type: recipe Google News india.recipe (2.8 KB, 196 views)
VoHegg is offline   Reply With Quote
Old 08-21-2020, 09:14 AM   #2
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
The same recipe for a german user

And hi again,
here is the same source for a german news content.
Look here

THIS one.
Attached Files
File Type: recipe Google News de.recipe (2.8 KB, 193 views)
VoHegg is offline   Reply With Quote
Advert
Old 08-21-2020, 09:25 AM   #3
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
letz do a look inside

Whats happend here?

Code:
class google_news_sample(BasicNewsRecipe):
    # variables you should change to fit your requests!
    # here are a sample for an english speaking user intrested in ebook content and news from Denver Colorado
    #       
    searchfor = 'ebook'		# a serarch topic, filled into the string below. You can change that to anything google news should be searched for...
    my_language_id = 'en' 	# may us, de,  or other.... change this if you want
    location	= 'DenverCo'

     # Titel of the Recipe - this is a sample
    title = 'Google News sample'
    cover_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Google_News_icon.svg/500px-Google_News_icon.svg.png'
    # Author
    __author__ = 'Volker Heggemann, VoHe'

# delete some stuff here
    
# feel free to add, wipe out what you need	 							---- can be edit by user
    #
    feeds          = [
                       ('Google news for '+location, 
                            'https://news.google.com/news/rss/headlines/section/geo/'+location),
                       ('Google news intrested in '+searchfor, 
                            'https://news.google.com/news?cf=all&hl='+my_language_id+'+&pz=1&ned='+my_language_id+'&q='+searchfor+'&output=rss'),
                     ]
because of the variables above the URL's this:
Code:
('Google news for '+location,'https://news.google.com/news/rss/headlines/section/geo/'+location)
changes to:
Code:
('Google news for DenverCo','https://news.google.com/news/rss/headlines/section/geo/DenverCo')
and this:
Code:
('Google news intrested in '+searchfor,'https://news.google.com/news?cf=all&hl='+my_language_id+'+&pz=1&ned='+my_language_id+'&q='+searchfor+'&output=rss')
now is:
Code:
('Google news intrested in ebook','https://news.google.com/news?cf=all&hl=en+&pz=1&ned=en&q=ebook&output=rss')
that's the whole trick.
So if YOU change the variables at the beginning (and may you need the news.google.com URL to the one of your country) you can get news for any place and any theme you intressted in.
VoHegg is offline   Reply With Quote
Old 08-21-2020, 09:50 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,310
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by VoHegg View Post
as i say above, i wonder why there is no google news feed recipe! Everyone 'googles' information!
Mostly because there is not much point since it has to be customised to be useable.
kovidgoyal is offline   Reply With Quote
Old 08-21-2020, 02:19 PM   #5
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
That's i reason i understand.
But that people using the recipies, could do this i guess....

But, may you are right, there should be a ready to uses google news recipe... wait, i test something...
VoHegg is offline   Reply With Quote
Advert
Old 08-21-2020, 02:56 PM   #6
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
Google News, ready to use recipe

Hi folks,

may this is what 'they' want.

With a little Python code the recipe get the location for your IP address.
And from this point, there is a chance to load the google news feeds.

In this sample i build a newspaper of three themes:

Google Topnews for your country code ('de' in my case)
Google news for your local city (a town in lower saxony in my case)
Google news for a keyword you set inside the recipe (i set 'computer' here)

and et voila, you got offline, whats mostly online works correct.

Is this usable?!
Attached Files
File Type: recipe Google rtu News de.recipe (3.2 KB, 183 views)
VoHegg is offline   Reply With Quote
Old 08-21-2020, 02:58 PM   #7
VoHegg
Enthusiast
VoHegg began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2013
Location: DE
Device: Linux PC's, Android devices, Amazon Fire HD10
oh, i forgot.
I name the title in recipe with the variable country_code.
In my case the recipe will be named as Google News de.
For someone from England, it will be named as Goolge News en
VoHegg is offline   Reply With Quote
Old 08-21-2020, 05:28 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,658
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by VoHegg View Post
oh, i forgot.
I name the title in recipe with the variable country_code.
In my case the recipe will be named as Google News de.
For someone from England, it will be named as Goolge News en
What abut someone from America?
JSWolf is online now   Reply With Quote
Old 08-21-2020, 11:21 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,310
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...8a9dc2feb135a9
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google News Recipe? awitko Recipes 6 11-03-2011 12:15 AM
calibre v08.19 the News Schedule isn't working. JayKindle Calibre 8 09-18-2011 04:17 AM
Google Apps for Domains - Google Reader recipe tweak bdillahu Recipes 0 04-13-2011 10:47 PM
The Moscow Times recipe isn't working. girlperson1 Calibre 4 12-01-2008 06:42 AM
Missing features: Gutenberg, Google Books, Google News, open RSS aggregator Charbax Amazon Kindle 10 11-22-2007 08:22 PM


All times are GMT -4. The time now is 10:18 AM.


MobileRead.com is a privately owned, operated and funded community.