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 07-13-2015, 06:34 AM   #1
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Fetch news - Date format not optimal

Hallo.

Fetch news imports me several times a week a magazine called Warentest.

I see a problem with the dates. Without manual intervention it doesn't list in chronological order due to the date format.

Name:  Warentest.png
Views: 337
Size:  17.1 KB
Status quo: [mié, 08 jul 2015] - better would be [2015/07/08], [2015.07.08] or [2015-07-08] - or [20150708], possibilities enough!

150708, that's the way I use dates, but maybe isn't altogether so clear.

Please change this somehow.

Or can I change that somewhere?
chaot is offline   Reply With Quote
Old 07-14-2015, 10:04 AM   #2
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
You can change it to your preferred display format:

calibre User Manual / News / API Documentation for recipes

Quote:
timefmt = ' [%a, %d %b %Y]'

The format string for the date shown on the first page. By default: Day_Name, Day_Number Month_Name Year
Divingduck is offline   Reply With Quote
Advert
Old 07-14-2015, 01:19 PM   #3
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Where I have to insert the new recipe timefmt = ' [%Y-%m-%d]'

Click image for larger version

Name:	Warentest(BasicNewsRecipe).png
Views:	240
Size:	63.1 KB
ID:	140275
So it doesn't function.

Last edited by chaot; 07-14-2015 at 01:47 PM.
chaot is offline   Reply With Quote
Old 07-14-2015, 03:19 PM   #4
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
works for me.
timefmt = ' [%Y-%b-%d, %a]' (see picture below) and timefmt = ' [%Y-%m-%d, %a]' too.

Edit: just recognize in your example that there are missing spaces in your code. You need to start at pos. 5

Attached Thumbnails
Click image for larger version

Name:	Timefmt.JPG
Views:	246
Size:	74.4 KB
ID:	140280  

Last edited by Divingduck; 07-14-2015 at 03:26 PM.
Divingduck is offline   Reply With Quote
Old 07-15-2015, 05:54 AM   #5
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Click image for larger version

Name:	Warentest(BasicNewsRecipe)_MODIFIZIERT.png
Views:	349
Size:	69.6 KB
ID:	140287
timefmt = ' [%Y-%m-%d]' at position 5 → don't function!?


Click image for larger version

Name:	Warentest [mie, 15 jul 2015].png
Views:	365
Size:	27.2 KB
ID:	140288
Trying a lot of different figurations, all negativ.
chaot is offline   Reply With Quote
Advert
Old 07-15-2015, 06:14 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,375
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaot View Post
Attachment 140287
timefmt = ' [%Y-%m-%d]' at position 5 → don't function!?


Attachment 140288
Trying a lot of different figurations, all negativ.
It works fine for me.

Using this recipe (the custom one, not the original one):
Code:
from calibre.web.feeds.news import BasicNewsRecipe

class Warentest(BasicNewsRecipe):
    title = u'Warentest'
    language = 'de'
    timefmt = ' [%Y-%m-%d]'
    description = 'Stiftung Warentest is a German consumer organisation and foundation involved in investigating and comparing goods and services in an unbiased way'
    __author__ = 'asdfdsfksd'
    needs_subscription = False
    max_articles_per_feed = 100
    auto_cleanup = True

    feeds = [(u'Test', u'http://www.test.de/rss/alles/')]

    def get_cover_url(self):
        return 'http://www.test.de/img/pp/logo.png'
I see the followiong in my library
Click image for larger version

Name:	Clipboard01.png
Views:	221
Size:	7.1 KB
ID:	140289

Be sure you run the customized recipe, not the standard one.
chaley is offline   Reply With Quote
Old 07-15-2015, 06:34 AM   #7
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Quote:
Originally Posted by chaley View Post
It works fine for me.
[...]
Be sure you run the customized recipe, not the standard one.
You are a lucky one!

Using your recipe for me it doesn't work. Maybe I don't run the customized recipe!? But I think I do. Please have a look.

Click image for larger version

Name:	custom_recipes.png
Views:	255
Size:	14.5 KB
ID:	140290
Clicking Show recipe files shows me Warentest_1002.recipe

from calibre.web.feeds.news import BasicNewsRecipe

class Warentest(BasicNewsRecipe):
title = u'Warentest'
language = 'de'
timefmt = ' [%Y-%m-%d]'
description = 'Stiftung Warentest is a German consumer organisation and foundation involved in investigating and comparing goods and services in an unbiased way'
__author__ = 'asdfdsfksd'
needs_subscription = False
max_articles_per_feed = 100
auto_cleanup = True

feeds = [(u'Test', u'http://www.test.de/rss/alles/')]

def get_cover_url(self):
return 'http://www.test.de/img/pp/logo.png'


Click image for larger version

Name:	Warentest [mie, 15 jul 2015].png
Views:	209
Size:	9.3 KB
ID:	140292
My view!

Last edited by chaot; 07-15-2015 at 06:39 AM.
chaot is offline   Reply With Quote
Old 07-15-2015, 06:39 AM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,375
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I run the recipe using the gui, as shown in the following.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.png
Views:	260
Size:	66.4 KB
ID:	140291  
chaley is offline   Reply With Quote
Old 07-15-2015, 07:02 AM   #9
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Now I am also a lucky one!

For completeness, the possibility is mentioned downloading both date formats, if so wanted. One must then activate both, e.g. cross each Schedule for download.

Respectively, crossing only ones Schedule for download is the intended procedure to suppress the unwanted date format. Fine!

Click image for larger version

Name:	Warentest (custom)_activated.png
Views:	243
Size:	105.2 KB
ID:	140294 Click image for larger version

Name:	Warentest (standard)_inactivated.png
Views:	238
Size:	99.2 KB
ID:	140295


Last edited by chaot; 08-10-2015 at 07:21 AM. Reason: rephrasing
chaot is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fetch news in AZW3 format? Eany Conversion 9 05-28-2018 09:52 PM
Change date format in fetched news/magazine titles? truth1ness Calibre 6 05-27-2015 12:15 PM
Date In News Titles (Fetch News) JamboUK Recipes 2 03-14-2013 10:16 AM
Fetch News doesn't (fetch news, that is) DJ Vollkasko Recipes 9 06-30-2012 03:11 AM
Fetch news into a specific format? davotibarna Calibre 8 01-10-2010 03:52 PM


All times are GMT -4. The time now is 04:41 AM.


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