Add verbose logging and fix character limit in Twitter class

This commit is contained in:
FujiwaraChoki committed 2024-02-14 12:03:29 +01:00
1 parent d206ec2461
commit cdc7341880
2 files changed
+10 -3

No files matched your search

+7
View File
@@ -1,5 +1,6 @@
import g4f
from status import *
from config import *
from constants import *
from .Twitter import Twitter
@@ -73,12 +74,18 @@ class AffiliateMarketing:
# Get the product name
product_title: str = self.browser.find_element(By.ID, AMAZON_PRODUCT_TITLE_ID).text
if get_verbose():
info(f"Product Title: {product_title}")
# Set the product title
self.product_title: str = product_title
# Get the features of the product
features: any = self.browser.find_elements(By.ID, AMAZON_FEATURE_BULLETS_ID)
if get_verbose():
info(f"Features: {features}")
# Set the features
self.features: any = features
+3 -3
View File
@@ -193,9 +193,9 @@ class Twitter:
sys.exit(1)
# Apply Regex to remove all *
completion = re.sub(r"\*", "", completion)
completion = re.sub(r"\*", "", completion).replace("\"", "")
if len(completion) >= 280:
self.generate_post()
if len(completion) >= 560:
return self.generate_post()
return completion