diff --git a/src/application.py b/src/application.py index 4a465b7d..92d44524 100644 --- a/src/application.py +++ b/src/application.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- name = 'TWBlue' -snapshot = True +snapshot = False if snapshot == False: version = "0.80" update_url = 'http://twblue.es/updates/twblue_ngen.json' diff --git a/src/keys/__init__.py b/src/keys/__init__.py index 1fe28f1d..3145f5a0 100644 --- a/src/keys/__init__.py +++ b/src/keys/__init__.py @@ -5,10 +5,17 @@ import exceptions from ctypes import c_char_p from libloader import load_library import paths -if platform.architecture()[0][:2] == "32": - lib = load_library("api_keys32", x86_path=paths.app_path("keys/lib")) +if application.snapshot == True: + if platform.architecture()[0][:2] == "32": + lib = load_library("snapshot_api_keys32", x86_path=paths.app_path("keys/lib")) + else: + lib = load_library("snapshot_api_keys64", x64_path=paths.app_path("keys/lib")) else: - lib = load_library("api_keys64", x64_path=paths.app_path("keys/lib")) + if platform.architecture()[0][:2] == "32": + lib = load_library("stable_api_keys32", x86_path=paths.app_path("keys/lib")) + else: + lib = load_library("stable_api_keys64", x64_path=paths.app_path("keys/lib")) + # import linuxKeys # lib = linuxKeys diff --git a/src/keys/lib/api_keys32.dll b/src/keys/lib/snapshot_api_keys32.dll similarity index 100% rename from src/keys/lib/api_keys32.dll rename to src/keys/lib/snapshot_api_keys32.dll diff --git a/src/keys/lib/api_keys64.dll b/src/keys/lib/snapshot_api_keys64.dll similarity index 100% rename from src/keys/lib/api_keys64.dll rename to src/keys/lib/snapshot_api_keys64.dll diff --git a/src/keys/lib/stable_api_keys32.dll b/src/keys/lib/stable_api_keys32.dll new file mode 100644 index 00000000..d8b1a54d Binary files /dev/null and b/src/keys/lib/stable_api_keys32.dll differ diff --git a/src/keys/lib/stable_api_keys64.dll b/src/keys/lib/stable_api_keys64.dll new file mode 100644 index 00000000..85687586 Binary files /dev/null and b/src/keys/lib/stable_api_keys64.dll differ diff --git a/src/long_tweets/twishort.py b/src/long_tweets/twishort.py index ea147903..635545a4 100644 --- a/src/long_tweets/twishort.py +++ b/src/long_tweets/twishort.py @@ -18,6 +18,7 @@ ############################################################ import requests import keys +import application from twitter import utils def get_twishort_uri(url): @@ -41,10 +42,14 @@ def get_full_text(uri): # return False def create_tweet(user_token, user_secret, text, media=0): + if application.snapshot == True: + url = "http://twblue.es/snapshot_twishort.php" + else: + url = "http://twblue.es/stable_twishort.php" data = {"user_token": user_token, "user_secret": user_secret, "text": text.encode("utf-8"), "media": media} - response = requests.post("http://twblue.es/twishort.php", data=data) + response = requests.post(url, data=data) # print response.json() return response.json()["text_to_tweet"] \ No newline at end of file