Changeset 831


Ignore:
Timestamp:
Jun 7, 2006, 11:03:03 PM (17 years ago)
Author:
GraemeWorthy
Message:

RssGetMacro:

[WEB-00]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rssgetmacro/0.9/RSSget.py

    r818 r831  
    7171def remove_old_cache(url):
    7272    filename = cache_lookup(url)
    73     print filename
     73#   print filename
    7474    os.remove(CACHE_DIR + "/" + CACHE_ID + "/" + filename)
    7575
     
    185185    # 1. check cache
    186186    cache_file = cache_lookup(url)
    187     print cache_file
     187#   print cache_file
    188188    if cache_file:
    189         print "checking freshness"
     189#       print "checking freshness"
    190190        cache_freshtest = freshness_check(cache_file, CACHE_INTERVAL)
    191         print cache_freshtest
     191#       print cache_freshtest
    192192    # 2. if there is a hit, make sure its fresh
    193193        if cache_freshtest:
    194             print "file is fresh"
     194#           print "file is fresh"
    195195            cache_contents = local_file_read(cache_file)
    196196            parsed_rss = parse_file(cache_contents)
    197             print parsed_rss
     197            #print parsed_rss
    198198            return parsed_rss
    199199    # 3. if cached obj fails freshness check, fetch remote
    200200        else:
    201             print "file is stale, getting remote"
     201#           print "file is stale, getting remote"
    202202            remote_rss = remote_url_get(url)
    203203            parsed_rss = parse_file(remote_rss)
    204204            return parsed_rss
    205205    else:
    206         print "there is no cache file, getting remote"
     206#       print "there is no cache file, getting remote"
    207207        remote_rss = remote_url_get(url)
    208208        parsed_rss = parse_file(remote_rss)
     
    212212    # not implemented
    213213   
     214#print rss_get_url('http://sxip.org/blog/?feed=rss')
    214215
    215216def execute(hdf, txt, env):
    216217    News = rss_get_url(txt)
    217     # Currently hdf is set only when the macro is called
    218     # From a wiki page
    219     if hdf:
    220         hdf['wiki.macro.greeting'] = 'Hello World'
    221218       
    222219    # args will be null if the macro is called without parenthesis.
Note: See TracChangeset for help on using the changeset viewer.