Changeset 831
- Timestamp:
- Jun 7, 2006, 11:03:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rssgetmacro/0.9/RSSget.py
r818 r831 71 71 def remove_old_cache(url): 72 72 filename = cache_lookup(url) 73 print filename73 # print filename 74 74 os.remove(CACHE_DIR + "/" + CACHE_ID + "/" + filename) 75 75 … … 185 185 # 1. check cache 186 186 cache_file = cache_lookup(url) 187 print cache_file187 # print cache_file 188 188 if cache_file: 189 print "checking freshness"189 # print "checking freshness" 190 190 cache_freshtest = freshness_check(cache_file, CACHE_INTERVAL) 191 print cache_freshtest191 # print cache_freshtest 192 192 # 2. if there is a hit, make sure its fresh 193 193 if cache_freshtest: 194 print "file is fresh"194 # print "file is fresh" 195 195 cache_contents = local_file_read(cache_file) 196 196 parsed_rss = parse_file(cache_contents) 197 print parsed_rss197 #print parsed_rss 198 198 return parsed_rss 199 199 # 3. if cached obj fails freshness check, fetch remote 200 200 else: 201 print "file is stale, getting remote"201 # print "file is stale, getting remote" 202 202 remote_rss = remote_url_get(url) 203 203 parsed_rss = parse_file(remote_rss) 204 204 return parsed_rss 205 205 else: 206 print "there is no cache file, getting remote"206 # print "there is no cache file, getting remote" 207 207 remote_rss = remote_url_get(url) 208 208 parsed_rss = parse_file(remote_rss) … … 212 212 # not implemented 213 213 214 #print rss_get_url('http://sxip.org/blog/?feed=rss') 214 215 215 216 def execute(hdf, txt, env): 216 217 News = rss_get_url(txt) 217 # Currently hdf is set only when the macro is called218 # From a wiki page219 if hdf:220 hdf['wiki.macro.greeting'] = 'Hello World'221 218 222 219 # args will be null if the macro is called without parenthesis.
Note: See TracChangeset
for help on using the changeset viewer.