示例#1
0
def dig_web():
    # twits = getTwits()
    twits = query_twitter("brhackday")
    # Twit(set(["brhackday"]))
    photos = getFlickers()
    words = []
    # for twit in twits:
    #    twit.content_tags = extractKeyWords(twit)
    #    words.append(twit)
    for photo in photos:
        photo.content_tags = photo.tags
        words.append(photo)
    return words
示例#2
0
            horario_post = datetime.datetime(now.year, now.month, dia, hora, min, seg) - datetime.timedelta(hours=2)

            #print horario_post
            tempo_passado = now - horario_post
            #print tempo_passado
            if (tempo_passado < datetime.timedelta(hours=1)):
                posts_na_ultima_hora +=1
                twits.append((post['from_user'], post['text']))
                print "* %s (%s)" % (tempo_passado, post['from_user'])
            #print "%s (%s)" % (tempo_passado, post['from_user'])
            #print data
            #if (tempo_passado <
            contador += 1
        n+=1
    
    photos = getFlickers()

    photos_tratadas = []
    contador = 0
    print "len(photos) = " + str(len(photos))
    for photo in photos:
        #import pdb
        #pdb.set_trace()
        if (int(photo.lastupdate) - time.time()+ 7200 < 3600):
            photos_tratadas.append({'type': 'flickr', 'url': photo.url, 'user': photo.username, 'tags': photo.tags})
            contador += 1
            if contador < 30:
                print "%d" % (int(photo.lastupdate) - time.time())
            
            
    print "contador flickr recentes=%d" % contador