fix minor error
This commit is contained in:
10
README.rst
10
README.rst
@@ -14,15 +14,9 @@ fbchat
|
|||||||
.. image:: https://pypip.in/license/fbchat/badge.svg?style=flat
|
.. image:: https://pypip.in/license/fbchat/badge.svg?style=flat
|
||||||
:target: https://pypi.python.org/pypi/fbchat
|
:target: https://pypi.python.org/pypi/fbchat
|
||||||
|
|
||||||
Facebook Chat (`Messenger <https://www.messenger.com/>`__) for Python. No XMPP or API key is needed. Just use your ID and PASSWORD.
|
Facebook Chat (`Messenger <https://www.messenger.com/>`__) for Python. This project was inspired by `facebook-chat-api <https://github.com/Schmavery/facebook-chat-api>`__.
|
||||||
|
|
||||||
This project was inspired by `facebook-chat-api <https://github.com/Schmavery/facebook-chat-api>`__.
|
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
|
||||||
=============
|
|
||||||
|
|
||||||
|
|
||||||
|
**No XMPP or API key is needed**. Just use your ID and PASSWORD.
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
|
@@ -10,21 +10,13 @@
|
|||||||
:license: BSD, see LICENSE for more details.
|
:license: BSD, see LICENSE for more details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
|
||||||
import json
|
|
||||||
import random
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from time import time
|
|
||||||
from uuid import uuid1
|
from uuid import uuid1
|
||||||
from random import random
|
from random import random, choice
|
||||||
from bs4 import BeautifulSoup as bs
|
from bs4 import BeautifulSoup as bs
|
||||||
|
|
||||||
from .utils import *
|
from .utils import *
|
||||||
|
|
||||||
CHROME = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
|
|
||||||
SAFARI = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/601.1.10 (KHTML, like Gecko) Version/8.0.5 Safari/601.1.10"
|
|
||||||
|
|
||||||
class Client(object):
|
class Client(object):
|
||||||
"""A client for the Facebook Chat (Messenger).
|
"""A client for the Facebook Chat (Messenger).
|
||||||
|
|
||||||
@@ -53,7 +45,7 @@ class Client(object):
|
|||||||
self._session = requests.session()
|
self._session = requests.session()
|
||||||
|
|
||||||
if not user_agent:
|
if not user_agent:
|
||||||
user_agent = CHROME
|
user_agent = choice(USER_AGENTS)
|
||||||
|
|
||||||
self._header = {
|
self._header = {
|
||||||
'Content-Type' : 'application/x-www-form-urlencoded',
|
'Content-Type' : 'application/x-www-form-urlencoded',
|
||||||
|
@@ -1,3 +1,16 @@
|
|||||||
|
import re
|
||||||
|
import json
|
||||||
|
from time import time
|
||||||
|
|
||||||
|
USER_AGENTS = [
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/601.1.10 (KHTML, like Gecko) Version/8.0.5 Safari/601.1.10",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.3; WOW64; ; NCT50_AAP285C84A1328) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
|
||||||
|
"Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6"
|
||||||
|
]
|
||||||
|
|
||||||
def now():
|
def now():
|
||||||
return int(time())
|
return int(time())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user