Example #1
0
def htmlSource(request):
  sites = ['FourChan', 'Fukung', 'Senorgif', 'Knowyourmeme' ]
  random.shuffle(sites)
  images = [] 
  images = globals()[sites[0]]().do().images()
  while not images:
   random.shuffle(sites)
   images = globals()[sites[0]]().do().images() 
  random.shuffle(images)
  if not Feed.gql("WHERE url = :1", images[0]).fetch(1):
    feed = Feed()
    feed.url = images[0]
    feed.put()
  return render_to_response('boardTemplate.html', {'image' : images[0]})
Example #2
0
def rss(request):
  feeds = Feed.gql('ORDER BY date DESC LIMIT 10')
  t = loader.get_template('rss.xml')
  c = Context({'feeds' : feeds, 'date' : feeds.fetch(1)[0].date})
  return HttpResponse(t.render(c), mimetype="application/xml")