quentincg / jarvis-fb-messenger Goto Github PK
View Code? Open in Web Editor NEW[Done] Control Jarvis assistant (http://openjarvis.com/) remotely using Facebook Messenger
License: MIT License
[Done] Control Jarvis assistant (http://openjarvis.com/) remotely using Facebook Messenger
License: MIT License
Add a config checker to be sure the config is correct.
Difficulty: 2-3 hours
Priority: Medium
Hello,
Thank you very much for this plugin, i use it since some weeks without issue.
but since today, plugin seams to don't login on Facebook (time since last login for other account don't move when I start Jarvis).
I've try to uninstall et install it again without change.
I've try to send a message using the python script "fb_messenger_send.py" but it does not work (I use a copy/past of a request that I use in a script to send some information to my FB account usually) :
python3 fb_messenger_send.py --email [email protected] --password MYPASSWORSHERE --receiver MYPERSONNALUSERIDHERE --message "Message to send"
It give (I think) the html code of the Facebook page and finish by some errors :
Traceback (most recent call last):
File "fb_messenger_send.py", line 142, in
main()
File "fb_messenger_send.py", line 134, in main
return_value = sendWithFacebookMessenger(email_address=_email, password=_password, receiver_id=_receiver, message=_message, image_path=_image, debug=True)
File "fb_messenger_send.py", line 35, in sendWithFacebookMessenger
client = fbchat.Client(email_address, password, debug, user_agent=None)
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 118, in init
self.login(email, password, max_retries)
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 328, in login
if not self._login():
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 233, in _login
self._post_login()
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 190, in _post_login
self.payloadDefault['__rev'] = int(r.text.split('"revision":',1)[1].split(",",1)[0])
IndexError: list index out of range
Is the plugin work for you? (it's possible that Facebook have make change that block the script)
What do you think I could do to make it work again?
thanks in advance
Sebastien
Hi Quentin,
@fredericsuretat opened this issue to complain about warnings displayed in the app.
Could you please filter on 'keys' in "non verbose" mode here, in order to display only "answer" field ?
Something like this :-)
if self.verbose_mode:
response_to_send += "{}: {}".format(str(key), str(value))
else:
if str( key ) == 'answer':
response_to_send += str(value)
Exemple of answer:
{
"warning": "No mic configured, forcing keyboard mode",
"warning": "No speaker configured, forcing mute",
"answer": "ça fonctionne"
}
Not working with last version of fbchat... let's have a look.
J'arrive pas a configurer le plugin. J'ai créé une page facebook, j'ai spécifié dans le fichier de configuration l'adresse émail et le mot passe. Pour le reste je ne vois pas se que je dois mettre. Je met si dessous se que je reçois sur le terminal et je comprends pas pourquoi j'ai l'erreur sur le login ?
jarvis: Bonjour monsieur
DEBUG:root:Initializing Facebook messenger server with email '[email protected]', getId='False', verbose='True', mute='True', allowAll='False' and allowedList='['id_1_here', 'id_2_here', 'id_3_here', '...']'.
ERROR:root:Login failed, check email/password.
WARNING:root:Facebook Messenger server crashed. Restarting...
Traceback (most recent call last):
File "/home/pi/jarvis/plugins_enabled/jarvis-fb-messenger/script/facebook_server.py", line 160, in
jarvis_fb_server.listen()
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 935, in listen
self.startListening()
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 911, in startListening
self.sticky, self.pool = self._getSticky()
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 740, in _getSticky
"channel": self.user_channel,
AttributeError: 'JarvisFacebookMessengerServer' object has no attribute 'user_channel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/jarvis/plugins_enabled/jarvis-fb-messenger/script/facebook_server.py", line 170, in
jarvis_fb_server.stop_listening()
AttributeError: 'JarvisFacebookMessengerServer' object has no attribute 'stop_listening'
I saw that SOMETIMES, the jv_pg_fb_send_message
function made the jarvis-facebook server stop.
If this function is never used, the server is working like a charm and request/response with messenger works perfectly.
More tests are needed in order to understand why this happens and have a better jv_pg_fb_send_message
function.
Difficulty: Unknown
Priority: Medium
I have installed sucessfully, I have configured entering my Jarvis's FB mail & password but when I start Jarvis I get errors. And when I send messages to it on Facebook I get no reply. Why is that? Is it working as expected?
The output when I start Jarvis is this:
Traceback (most recent call last):
File "/home/pi/jarvis/plugins_enabled/jarvis-fb-messenger/script/facebook_server.py", line 10, in <module>
import fbchat # Use facebook messenger library
File "/usr/local/lib/python3.4/dist-packages/fbchat/__init__.py", line 14, in <module>
from .client import *
File "/usr/local/lib/python3.4/dist-packages/fbchat/client.py", line 20, in <module>
from bs4 import BeautifulSoup as bs
ImportError: No module named 'bs4'
./jarvis.sh: line 407: false_STT: command not found
./jarvis.sh: line 407: false_STT: command not found
Edit 1: I have installed BeautifulSoup4 but nothing changed.
Edit 2: I am running Jarvis on Rpi 2.
Hi, I'm writting this post because I need help for the messenger plugin.
When I launch jarvis, log shows me that messenger is connected and with my pricipal account, it shows me that jarvis has readen the message but it doesn't answer to it.
Could you help me please?
Un like ou un fichier envoyé à Jarvis via messenger fait bugger Jarvis... ca semble etre un bug de Jarvis): alexylem/jarvis#583
Il est cependant possible de ne pas envoyer une commande vide via le plugin pour éviter ce genre de soucis.
Hello, merci pour ton super plugin ! Je n'arrive pas du tout à le faire fonctionner il me dit que mon login / pass est pas correct alors que si (j'ai retesté en navigation privée pour être sûr). Voici mes logs
INFO:snowboy:Ticks: [2, 20, 5, -1]
DEBUG:root:Initializing Facebook messenger server with email '[email protected]', getId='False', verbose='True', mute='True', allowAll='False' and allowedList='['10XXX']'.
Logging in [email protected]...
INFO:client:Logging in [email protected]...
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): m.facebook.com
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /?__req=1&seq=0 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /login/save-device/?login_source=login&refsrc=https%3A%2F%2Fwww.facebook.com%2F&_rdr HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /login/save-device/cancel/ HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?_rdr HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?_rdr HTTP/1.1" 200 None
Attempt #1 failed, retrying
WARNING:client:Attempt #1 failed, retrying
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /?__req=3&seq=0 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?__req=3&_rdr HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?_rdr HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?_rdr HTTP/1.1" 200 None
Attempt #2 failed, retrying
WARNING:client:Attempt #2 failed, retrying
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /?__req=5&seq=0 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?__req=5&_rdr HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?_rdr HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?_rdr HTTP/1.1" 200 None
Attempt #3 failed, retrying
WARNING:client:Attempt #3 failed, retrying
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /?__req=7&seq=0 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?__req=7&_rdr HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?_rdr HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?_rdr HTTP/1.1" 200 None
Attempt #4 failed, retrying
WARNING:client:Attempt #4 failed, retrying
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /?__req=9&seq=0 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?__req=9&_rdr HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?_rdr HTTP/1.1" 302 0
DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /gettingstarted/?_rdr HTTP/1.1" 200 None
Attempt #5 failed
WARNING:client:Attempt #5 failed
ERROR:root:Login failed, check email/password.
Bonjour,
J'ai remarqué qu'après un certain temps le serveur se stop et il est impossible de communiquer avec Jarvis via messenger alors que Jarvis fonctionne toujours en background.
pour tester j'ai laisser Jarvis tourner toute la nuit et ce matin fb-messenger ne répondais plus.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.