Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2011, 03:58 PM   #1
julio:map
Member
julio:map began at the beginning.
 
Posts: 23
Karma: 12
Join Date: Jul 2011
Device: Cool-er
Smile Techtarget feeds recipe

I have written a recipe for Techtarget feeds.

From Techtarget website:
TechTarget gives technology professionals and buyers the technical information they need to perform their jobs -- researching products, developing strategy, and making cost-effective purchase decisions.

You can register for free in any of the techtarget webs, for example:
http://searchservervirtualization.techtarget.com/

You can of course, add or delete feeds in the last lines of code.

I hope someone finds it useful too.

Spoiler:
Code:
class TechTarget(BasicNewsRecipe):
    title          = u'Techtarget'
    __author__            = 'Julio:map'
    description           = '''IT Infrastructure related blogs
                                    from Techtarget'''
    publisher             = 'Techtarget'
    category              = 'IT, Infrastructure'
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    needs_subscription    = True
    auto_cleanup = False
    LOGIN = u'http://searchservervirtualization.techtarget.com/login'

    def get_browser(self):
        br = BasicNewsRecipe.get_browser()
        if self.username is not None:
            br.open(self.LOGIN)
            br.select_form(nr=1)
            br['email'] = self.username
            if self.password is not None:
               br['password'] = self.password
            br.submit()
        return br

    keep_only_tags = [dict(name='div', attrs={'id':'article'})]
    remove_tags= [dict(name='div', attrs={'id':['articleToolbar','relatedContent']})]
    remove_tags_after = [dict(name='div', attrs={'id':'relatedContent'})]


    feeds          = [
       (u'IT news and analysis for CIOs', u'http://feeds.pheedo.com/SearchCIOITNewsAndAnalysisForCIOs'),
       (u'TotalCIO', u'http://feeds.pheedo.com/1532.xml'),
       (u'SearchCIO-Midmarket: Technology news and tips for midmarket CIOs', u'http://feeds.pheedo.com/techtarget/Searchsmb/Smbs'),
       (u'Compliance news and advice for senior IT and business managers', u'http://feeds.pheedo.com/tt/1200'),
       (u'Server virtualization news and opinions', u'http://feeds.pheedo.com/SearchservervirtualizationServerVirtualizationNewsAndOpinions'),
       (u'The Virtualization Room', u'http://feeds.pheedo.com/techtarget/nzLe'),
       (u'Server virtualization technical tips and expert advice', u'http://feeds.pheedo.com/SearchservervirtualizationServerVirtualizationTechnicalTipsAndExpertAdvice'),
       (u'Cloud Computing news and Technical Advice', u'http://feeds.pheedo.com/1260'),
       (u'IT infrastructure news', u'http://feeds.pheedo.com/techtarget/Searchdatacenter/ItInfrastructure'),
       (u'Storage Channel Update', u'http://feeds.pheedo.com/ChannelMarker-TheItChannelWeblog'),
       (u'VMware Tips and News', u'http://feeds.pheedo.com/SearchvmwarecomVmwareTipsAndTricks'),
       (u'Enterprise IT news roundup', u'http://feeds.pheedo.com/WhatisEnterpriseItNewsRoundup'),
       (u'WhatIs: Enterprise IT tips and expert advice', u'http://feeds.pheedo.com/WhatisEnterpriseItTipsAndExpertAdvice'),
       (u'WhatIs: Enterprise IT news roundup', u'http://feeds.pheedo.com/WhatisEnterpriseItNewsRoundup'),
       ]

Last edited by Starson17; 11-09-2011 at 09:27 AM.
julio:map is offline   Reply With Quote
Old 11-09-2011, 07:42 AM   #2
julio:map
Member
julio:map began at the beginning.
 
Posts: 23
Karma: 12
Join Date: Jul 2011
Device: Cool-er
Small change

I have updated the "keep_only_tags" because some feeds where not working.
Spoiler:

Code:
class TechTarget(BasicNewsRecipe):
    title          = u'Techtarget'
    __author__            = 'Julio:map'
    description           = '''IT Infrastructure related blogs
                                    from Techtarget'''
    publisher             = 'Techtarget'
    category              = 'IT, Infrastructure'
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    needs_subscription    = True
    auto_cleanup = False
    LOGIN = u'http://searchservervirtualization.techtarget.com/login'

    def get_browser(self):
        br = BasicNewsRecipe.get_browser()
        if self.username is not None:
            br.open(self.LOGIN)
            br.select_form(nr=1)
            br['email'] = self.username
            if self.password is not None:
               br['password'] = self.password
            br.submit()
        return br

    keep_only_tags = [dict(name='div', attrs={'id':'article'}),dict(name='div', attrs={'class':'entry'})]
    remove_tags= [dict(name='div', attrs={'id':['articleToolbar','relatedContent']})]
    remove_tags_after = [dict(name='div', attrs={'id':'relatedContent'})]


    feeds          = [
       (u'IT news and analysis for CIOs', u'http://feeds.pheedo.com/SearchCIOITNewsAndAnalysisForCIOs'),
       (u'TotalCIO', u'http://feeds.pheedo.com/1532.xml'),
       (u'SearchCIO-Midmarket: Technology news and tips for midmarket CIOs', u'http://feeds.pheedo.com/techtarget/Searchsmb/Smbs'),
       (u'Compliance news and advice for senior IT and business managers', u'http://feeds.pheedo.com/tt/1200'),
       (u'Server virtualization news and opinions', u'http://feeds.pheedo.com/SearchservervirtualizationServerVirtualizationNewsAndOpinions'),
       (u'The Virtualization Room', u'http://feeds.pheedo.com/techtarget/nzLe'),
       (u'Server virtualization technical tips and expert advice', u'http://feeds.pheedo.com/SearchservervirtualizationServerVirtualizationTechnicalTipsAndExpertAdvice'),
       (u'Cloud Computing news and Technical Advice', u'http://feeds.pheedo.com/1260'),
       (u'IT infrastructure news', u'http://feeds.pheedo.com/techtarget/Searchdatacenter/ItInfrastructure'),
       (u'Storage Channel Update', u'http://feeds.pheedo.com/ChannelMarker-TheItChannelWeblog'),
       (u'VMware Tips and News', u'http://feeds.pheedo.com/SearchvmwarecomVmwareTipsAndTricks'),
       (u'Enterprise IT news roundup', u'http://feeds.pheedo.com/WhatisEnterpriseItNewsRoundup'),
       (u'WhatIs: Enterprise IT tips and expert advice', u'http://feeds.pheedo.com/WhatisEnterpriseItTipsAndExpertAdvice'),
       (u'WhatIs: Enterprise IT news roundup', u'http://feeds.pheedo.com/WhatisEnterpriseItNewsRoundup'),
       ]

Last edited by Starson17; 11-09-2011 at 09:27 AM.
julio:map is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicated news in recipe with multiple feeds romualdinho Recipes 5 09-24-2012 09:27 PM
Recipe works when mocked up as Python file, fails when converted to Recipe ode Recipes 7 09-04-2011 04:57 AM
Modifying different feeds in one recipe rjchew Recipes 1 08-03-2011 01:27 PM
Recipe for Reading Blog Feeds possible ? markwaters Recipes 6 06-22-2011 12:55 PM
One Recipe, Multiple Feeds, Different Printer-Friendly Subs DTM Recipes 9 02-11-2011 01:04 PM


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


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