Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter Posting #115

Closed
rick165 opened this issue Feb 8, 2024 · 6 comments
Closed

Twitter Posting #115

rick165 opened this issue Feb 8, 2024 · 6 comments

Comments

@rick165
Copy link

rick165 commented Feb 8, 2024

Is there any fix to the following error since twitter changed the api access?
:pywws.service.twitter:TwitterError([{u'message': u'You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product', u'code': 453}],)

@jim-easterbrook
Copy link
Owner

No, unless someone wants to pay Twitter $100 per month for pywws to be able to post messages.

@rick165
Copy link
Author

rick165 commented Feb 8, 2024

I did wonder after it stopped working in July 23 and it hadn't been fixed yet. Shame really, oh well I'll post the stats on mastodon instead. Thanks for the feedback Jim, been using pywws for longer than I can remember 😊

@rick165 rick165 closed this as completed Feb 8, 2024
@rick165
Copy link
Author

rick165 commented Feb 19, 2024

I've looked into this and I believe the free account is allowed to post up to 1500 posts a month, so in theory if the user only tweeted hourly weather conditions, it'd equate to approx 740+ tweets a month.
I've managed to do a test tweet using tweepy and the new v2 api using the following code


import tweepy

CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_KEY = ""
ACCESS_SECRET = ""

# Twitter API v2 --- Will be used to post the tweet
client_v2 = tweepy.Client(
    consumer_key=CONSUMER_KEY,
    consumer_secret=CONSUMER_SECRET,
    access_token=ACCESS_KEY,
    access_token_secret=ACCESS_SECRET
)

response = client_v2.create_tweet(text="hello world")

@jim-easterbrook
Copy link
Owner

jim-easterbrook commented Feb 19, 2024

pywws has more than one user. If you create your own developer account and generate your own key/secret then you can post to Twitter. But if you share that key/secret (as pywws does) then all the users soon add up to more than 1500 posts per month.

@rick165
Copy link
Author

rick165 commented Feb 19, 2024

Apologies, I'd always used pywws with my own twitter account in isolation.

@jim-easterbrook
Copy link
Owner

There are two sets of key/secret pairs. The one corresponding to your user account, which is stored in weather.ini, and the consumer_key and consumer_secret which are stored in pywws/constants.py. It is the latter that are shared between pywws users. You can obtain your own consumer_key and consumer_secret by registering as a Twitter developer and creating a set of credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants