Created
September 1, 2010 15:12
-
-
Save marcelcaraciolo/560831 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for monitoramento in monitor_videos.find(): | |
termos = {} | |
for video in monitoramento['value']['videos']: | |
x = db.youtube_history.find({'cod_video': video, 'date_year': final_date.year, 'date_hour': final_date.hour, | |
'date_month': final_date.month, 'date_day': final_date.day, | |
'classificacao': True}) | |
for historico in x: | |
for termo in historico['terms']: | |
termos.setdefault(termo,0) | |
termos[termo] += historico['view_count'] | |
print termos | |
termos = {} | |
for video in monitoramento['value']['videos']: | |
x = db.youtube_history.find({'cod_video': video, 'date_year': final_date.year, 'date_hour': final_date.hour, | |
'date_month': final_date.month, 'date_day': final_date.day, | |
'classificacao': False}) | |
for historico in x: | |
for termo in historico['terms']: | |
termos.setdefault(termo,0) | |
termos[termo] += historico['view_count'] | |
print termos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment