## Load configuration from file config = OptConfigReader() config.setup() ## start the logger Logger().setup() ########################### # init of the flickr api api = API() if user: user = api.getUserFromAll() page.h3(user['username'], onclick='alert("'+user['id']+'");') page.a('rss', href='rss.py?user_id=%s'%(user['id']),) page.br() photos = api.getUserPhotos(user['id']) existing = Existing().grepPhotosExists(photos) existing_ids = map(lambda e:e['id'], existing) urls = api.getPhotoURLFlickr(photos, True, True) for id in urls: if id in existing_ids: style = 'border:1px red solid;' else: style = 'border:1px blue solid;' page.img(src=urls[id], width=100, height=80, alt=id, onclick='alert("'+id+'");', style=style) else: page.h3("showing last photos of your contacts") # params = {"contacts":"ff", "min_upload_date":"1287399869", "extra":"url_sq"}
if 'user_id' in form: user_id = form['user_id'].value else: user_id = '53753127@N03' user = api.getUserFromAll(user_id) username = user['username'] page = FDH_page() page.init(css = ('pouet.css')) page.table(width='100%', height='80%') page.tr(height='30px') page.td() page.a('contacts', href='http://www.flickr.com/people/%s/contacts/by-uploaded/'%username, target='_blank') page.td.close() page.td() page.a('friends', href='http://www.flickr.com/people/%s/contacts/rev/'%username, target='_blank') page.td.close() page.td() page.td.close() page.tr.close() page.tr(height='100%') page.td(colspan='5', valign='top') page.iframe(src='http://api.flickr.com/services/feeds/activity/all?user_id=%s&format=csv'%user_id, width='50%', height='50%') page.iframe.close() page.td.close() page.td()
# page.img(src='proxy.py?%s'%urllib.urlencode({"url":photo['url_sq']}), alt="%s (%s) : %s"%(username, user_id, id), style=style) page.a.close() ########################################### page = FDH_page() page.init(css = ('/styles/favorites.css'), header="Favorites (page %i)"%page_num) page.script('', src='/javascript/menu2.js', type='text/javascript') page.script('', src='/javascript/ajax.js', type='text/javascript') manager = PhotoManager(FavoritesBackup()) photos = manager.getPhotos() page.div() if page_num != 0: page.a("Previous", href='favorites.py?%s'%urllib.urlencode({ 'page_num':page_num-1, 'perpage':perpage, 'user_id':user_id })) if (page_num+1)*perpage < len(photos): page.a("Next", href='favorites.py?%s'%urllib.urlencode({ 'page_num':page_num+1, 'perpage':perpage, 'user_id':user_id })) page.a("Export", href="favorites_action.py?action=export") page.div.close() lproxy = LocalProxy() photos = lproxy.modifyProxyPhotos(photos[page_num*perpage:(page_num+1)*perpage], 'url_sq') for photo in photos: #photos[page_num*perpage:(page_num+1)*perpage]: display_photo(page, photo) print page