Code Monkey home page Code Monkey logo

t-hoarder's People

Contributors

congosto avatar jj avatar numeroteca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

t-hoarder's Issues

Error de autenticación del usuario

La herramienta ejecuta los experimentos pero no genera los outputs esperados, no realiza una descarga de tweets ni consume los recursos de la API.

En un primer momento se estructuró el expermiento como aparece en la wiki, tras su ejecución, el archivo nohup.out establecía un error de no encontrar el archivo en la carpeta "keys" correspondiente al "bearer token" tal que así:

ohup: appending output to '/home/osboxes/nohup.out'

En el archivo aparece el siguiente error:

-->File output: /home/osboxes/Desktop//t-hoarder/store/streaming_SabadoTest.txt
Traceback (most recent call last):
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 462, in
main()
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 440, in main
oauth=oauth_keys(app_keys_file,user_keys_file)
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 45, in init
f = open( self.user_keys_file, 'rU')
IOError: [Errno 2] No such file or directory: '/home/osboxes/Desktop//t-hoarder/keys/AAAAAAAAAAAAAAAAAAAAAKclWAEAAAAAmxxx.key'
run command python2.7 /home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py /home/osboxes/Desktop/ SabadoTest AppMr.XX.key AAAAAAAAAAAAAAAAAAAAAKclWAEAAAAAmpUtc7xxxDSkuZ0.key --words words.txt

Ya que veo que me solicita un archivo con el nombre del Bearer token, creo un txt con el nombre del Bearer token y lo incluyo en su interior:

─(osboxes㉿osboxes)-[~/Desktop/t-hoarder/keys]
└─$ ls
AAAAAAAAAAAAAAAAAAAAAKclxxx0.key
AppMr.XX.key
XXXXXX.key

Ahora el error es diferente y solo me da errores de autenticación relativos a las líneas del script tweet streaming large:

-->File output: /home/osboxes/Desktop//t-hoarder/store/streaming_SabadoTest.txt
Error in oauth autentication, user key
Traceback (most recent call last):
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 462, in
main()
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 440, in main
oauth=oauth_keys(app_keys_file,user_keys_file)
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 54, in init
print 'Error in oauth autentication, user key ', user_keys_file_num
NameError: global name 'user_keys_file_num' is not defined

Alguna idea de como autenticarme correctamente? Donde puede estar el error?

Gracias de antemano. @congosto

¿Cual es el Modus operandi / work flow?

Una vez tenemos instalado t-hoarder y funcionando ¿cual es la forma de trabajar?

Me surgen algunas preguntas de la Capa 1 (Recolección y almacenamiento de datos):

  • ¿Cuántos streamings simultáneos se pueden correr con un mismo usuario de Twitter?
  • ¿Cuántos streamings simultáneos se pueden correr desde un mismo servidor?

Actualmente tengo dos streamings corriendo en el server con el mismo usuario de Twitter, cuando lanzo un tercero se para el streaming.

  • ¿Para que sirven este tipo de archivos que se generan al correr el script prueba1.number?
  • ¿Cómo funcionan los archivos prueba1_0.txt? ¿llegado a un máximo de líneas prueba1_0.txt se genera un prueba1_1.txty se comprime el primero (como los logs de un server?

Cuando se pueda hará falta tutoriales para:

  • Capa 2: Procesado de datos
  • Capa 3: Visualización

Error en la autenticación del usuario

La herramienta ejecuta los experimentos pero no genera los outputs esperados, no realiza una descarga de tweets ni consume los recursos de la API.

En un primer momento se estructuró el expermiento como aparece en la wiki, tras su ejecución, el archivo nohup.out establecía un error de no encontrar el archivo en la carpeta "keys" correspondiente al "bearer token" tal que así:

ohup: appending output to '/home/osboxes/nohup.out'

En el archivo aparece el siguiente error:

-->File output: /home/osboxes/Desktop//t-hoarder/store/streaming_SabadoTest.txt
Traceback (most recent call last):
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 462, in
main()
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 440, in main
oauth=oauth_keys(app_keys_file,user_keys_file)
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 45, in init
f = open( self.user_keys_file, 'rU')
IOError: [Errno 2] No such file or directory: '/home/osboxes/Desktop//t-hoarder/keys/AAAAAAAAAAAAAAAAAAAAAKclWAEAAAAAmxxx.key'
run command python2.7 /home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py /home/osboxes/Desktop/ SabadoTest AppMr.XX.key AAAAAAAAAAAAAAAAAAAAAKclWAEAAAAAmpUtc7xxxDSkuZ0.key --words words.txt

Ya que veo que me solicita un archivo con el nombre del Bearer token, creo un txt con el nombre del Bearer token y lo incluyo en su interior:

─(osboxes㉿osboxes)-[~/Desktop/t-hoarder/keys]
└─$ ls
AAAAAAAAAAAAAAAAAAAAAKclxxx0.key
AppMr.XX.key
XXXXXX.key

Ahora el error es diferente y solo me da errores de autenticación relativos a las líneas del script tweet streaming large:

-->File output: /home/osboxes/Desktop//t-hoarder/store/streaming_SabadoTest.txt
Error in oauth autentication, user key
Traceback (most recent call last):
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 462, in
main()
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 440, in main
oauth=oauth_keys(app_keys_file,user_keys_file)
File "/home/osboxes/Desktop//t-hoarder/scripts/tweet_streaming_large.py", line 54, in init
print 'Error in oauth autentication, user key ', user_keys_file_num
NameError: global name 'user_keys_file_num' is not defined

Alguna idea de como autenticarme correctamente? Donde puede estar el error?

Gracias de antemano.

¿Se puede eliminar el paso de crear claves de usuario?

En el paso Crear claves de usuario se requiere acceder a un navegador para obtener el PIN que genere el archivo user.key en la carpeta /keys.
Veo que en apps.twitter.com se puede acceder a los mismos datos en la seccion Your Access Token de la app.

¿Se podría escribir directamente el archivo user.key con los datos del Your Access Token (Access Token y Access Token Secret)? ¿o por el contrario es necesario para identificar al server?

Actualización de palabras de búsqueda compartida

Una idea para hacer el cambio de palabras de búsqueda más distribuido y compartido: habría que tener las palabras en archivo compartido ¿google spreadsheet? para poder cambiar y actualizar fácilmente qué es lo que se monitoriza.
Un script comprobaría en cada rearranque si esas palabras han cambiado además de incluir el cambio en el log (#7).

Problemas al ejecutar CGI

Estoy tratando de hacer funcionar el procesado que hace t-hoarder de todos los archivos comprimidos (.tar.gz) de un experimento. He documentado en la wiki parte del proceso.

Me está costando hacerlo funcionar por un problema de configuración de CGI. Caad vez que acedo a la web del experimento me sale el archivo tweets_talk_cgi.py como si lo quisiera descargar:
Screenshot from 2020-06-19 18-49-29
en vez de ejecutarlo.

He seguido este manual https://httpd.apache.org/docs/2.4/es/howto/cgi.html y este otro https://code-maven.com/set-up-cgi-with-apache

Usaré este hilo para documentar cómo tengo configurado todo a ver si consigo hacerlo funcionar.

En /etc/apache2/conf-available$ mi archivo serve-cgi-bin.conf es:

<IfModule mod_alias.c>
	<IfModule mod_cgi.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>

	<IfModule mod_cgid.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>

	<IfDefine ENABLE_USR_LIB_CGI_BIN>
		ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		<Directory "/usr/lib/cgi-bin">
			AllowOverride None
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Require all granted
		</Directory>
		
		ScriptAlias /scripts/ /home/numeroteca/data/t-hoarder/web/scripts/ 
		<Directory "/home/numeroteca/data/t-hoarder/web/scripts">
			Options +ExecCGI
			#AddHandler mod_python .py
			#PythonHandler mod_python.publisher
			AddHandler cgi-script .pl
			Order allow,deny
			Allow from all
		</Directory>

	</IfDefine>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

En /etc/apache2/mods-enabled tengo:
lrwxrwxrwx 1 root root 26 jun 19 17:29 cgi.conf -> ../mods-available/cgi.conf
lrwxrwxrwx 1 root root 26 jun 10 16:53 cgi.load -> ../mods-available/cgi.load

y en /etc/apache2/mods-available tengo:
lrwxrwxrwx 1 root root 24 jun 19 17:30 cgi.conf -> ../mods-enabled/cgi.conf
-rw-r--r-- 1 root root 115 oct 10 2018 cgid.conf
-rw-r--r-- 1 root root 60 oct 10 2018 cgid.load
-rw-r--r-- 1 root root 58 oct 10 2018 cgi.load

Sí, hay una doble liga recursiva, sí.

Seguiré informando :) @congosto

Que el .log guarde los nombres de las key words

Esto será útil para luego mirar qué palabras se estaban buscando exactamente en ese momento.
A veces las key words van cambiando a lo largo de la investigación y el .log es un buen sitio para tener guardados esos cambios.

Generating a 406 error

I'm trying to understand how to use this on Windows. I got it set up, and I have the following issue:

-->File output:  C:\Users\Jacob\documents\github\t-hoarder\store\streaming_test_words.txt
Init Files_output C:\Users\Jacob\documents\github\t-hoarder\store\ streaming_test_words txt
None None []
---------------->An error has occured! Status code = 406 at 2017-07-18 02:47:36.937000

etc...

I'm just trying simple searches with simple keywords, as per the setup instructions. My brief research suggests there's a problem with the headers or handling the format that Twitter pushes out. Is that an issue inside T-hoarder? Or is it an issue with the tools I have in Windows..? Any idea how to approach solving this problem?
Thanks!

Error while creating credentials to access the API

While selecting option 1 "1.Create credentials to access the API"

The message displayed is

Before creating the credentials you must:

  1. Create a Twitter app (https://apps.twitter.com) see instructions on the wiki (https://github.com/congosto/t-hoarder/wiki/Create-credits-to-access-a- The-API)
  2. Save Consumer Key & Consumer Secret (one key per line without leaving spaces or tabs) in a file with the name of the app and the extension 'key' in the directory keys:
  3. Create a Twitter profile for each experiment
    If you have completed steps 1, 2 and 3 you can now create credentials for a Twitter profile with the app

Is it correct? Don't we need the creation of two files?

  • nameoftheapp.key (with Access Token Access + Token Secret in two lines)
  • nameofuser.key (with Consumer Key (API Key) + Consumer Secret (API Secret) in two lines)

We need to update the info at https://github.com/congosto/t-hoarder/wiki/Create-credits-to-access-a- The-API\

I am asking this because I get an error in this step:

Enter the file name with the application keys:
nameoftheapp.key
Enter the twitter profile:
nameofuser
Traceback (most recent call last):

  File "/home/numeroteca/t-hoarder_kit/scripts/tweet_auth.py", line 67, in <module>
    main()
  File "/home/numeroteca/t-hoarder_kit/scripts/tweet_auth.py", line 63, in main
    get_access_key(keys_app_file, username)
  File "/home/numeroteca/t-hoarder_kit/scripts/tweet_auth.py", line 36, in get_access_key
    webbrowser.open(auth.get_authorization_url())
  File "/usr/local/lib/python2.7/site-packages/tweepy/auth.py", line 88, in get_authorization_url
    raise TweepError(e)
tweepy.error.TweepError: Token request failed with code 401, response was '{"errors":[{"code":32,"message":"Could not authenticate you."}]}'.

El script se detiene inesperadamente

A veces se me interrumpe el script, pero no sé por qué razón.

@congosto ¿te ha pasado antes?

Me ha dado este error:

~/t-hoarder/store$ Traceback (most recent call last):
  File "/home/numeroteca/t-hoarder/scripts/tweet_streaming.py", line 303, in <module>
    main()
  File "/home/numeroteca/t-hoarder/scripts/tweet_streaming.py", line 299, in main
    stream.filter(follow_list, track_list,False,locations_list_int)
  File "/usr/local/lib/python2.7/site-packages/tweepy/streaming.py", line 445, in filter
    self._start(async)
  File "/usr/local/lib/python2.7/site-packages/tweepy/streaming.py", line 361, in _start
    self._run()
  File "/usr/local/lib/python2.7/site-packages/tweepy/streaming.py", line 294, in _run
    raise exception
requests.packages.urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read, 695 more expected)', IncompleteRead(0 bytes read, 695 more expected))
grep -vc '^$' *^C
[3]+  Exit 1                  tweet_streaming.py $HOME rita my_app.key numeroteca.key --words words.txt  (wd: ~/t-hoarder/store/datos_rita)
(wd now: ~/t-hoarder/store)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.