devhindo / x

post tweets from terminal
https://x-blush.vercel.app
MIT License
27 stars 2 forks source link

Failed to unmarshal response #47

Open mesb1 opened 3 months ago

mesb1 commented 3 months ago

After some time of success work, it has stopped with:

Failed to unmarshal response

I tried to relogin, nothing helps. Is there any ideas how to diag?

devhindo commented 3 months ago

Relogging should be done by running x auth -c (clear) to clear the previous configuration and start the auth process again by running x auth and continue from there.

Can you provide the CLI command that caused this error? Was it a normal text tweet? Maybe you exceeded the 280-character limit set by Twitter? I don't have error handling for that yet.

Also, Did you achieve a successful post? Or it still doesn't work on your remote machine.

mesb1 commented 3 months ago

It doesn't work for my remote machine after some time. It was successfully verified, but I when post something now there is a error and nothing posted on my twitter.

mesb1 commented 3 months ago

Relogging should be done by running x -c

Not working, only: x auth -c

mesb1 commented 3 months ago

Was it a normal text tweet? Maybe you exceeded the 280-character limit set by Twitter?

Yep, just like example, only number added.

devhindo commented 3 months ago

Did you move the .tempxcli file to the remote machine home directory? What is the OS used on your remote machine? Also can you check this and provide the full prompt and the error message

mesb1 commented 3 months ago

Did you move the .tempxcli file to the remote machine home directory?

No, i was able to make your app working for some moment. Not really clear, but i did. I have shared info of what i have done inside issue #46

mesb1 commented 3 months ago

What is the OS used on your remote machine?

Almalinux 8 minimal, no gui, no any additional software, just base system, streamer, my scripts and your app.

mesb1 commented 3 months ago

It looks like last time it was working about couple of days, from 14 upto 17 of july. Posts includes some hashtags, link to streaming project and track author - name. It is about 200 symbols limits was set since i was using oysttyer.

mesb1 commented 3 months ago

For now it is working again, from this point, so let's see how it goes for the next day.

devhindo commented 3 months ago

What is the OS used on your remote machine?

Almalinux 8 minimal, no gui, no any additional software, just base system, streamer, my scripts and your app.

That's cool

mesb1 commented 3 months ago

If possible there is a sense to add a bit more debug via --debug key as it is not clear on which side it was broken, between app and 3rd party server or 3rdparty server and twitter itself.

mesb1 commented 3 months ago

Looks like i have run into problem again. It happens about 3 hours ago, app stops working again:

./x -t "testing2" Failed to unmarshal response

Also it looks like this message doesn't have start from new line. As my automated part looks like after a few fails: Failed to unmarshal responseFailed to unmarshal responseFailed to unmarshal response How can i assist with diag?

mesb1 commented 3 months ago

And now working again, tried 7 times before with no luck.

mesb1 commented 3 months ago

And same happens again.

Do we have some limitations somewhere?

devhindo commented 3 months ago

So the X API is responsible for this. They are blocking the tweet with statusText: 'Too Many Requests' according to their free API plan

image

1500 tweets are allowed under the free plan, distributed in 30 days. That means only 50 tweets per day (and we exceeded this today, So your tweet is not getting posted. Tomorrow the counter will reset to 0 and you will be able to post again).

image

image

The only way to bypass this is to pay for their API pro plans and I don't have the capabilities to this right now as they are ridiculously overpriced.

image

Sadly this sets a limitation for this tool. I was hoping to do further development to allow scheduling future tweets and some other cool ideas but now I might reconsider as their paid plans are ridiculously overpriced.

tho I might find a workaround to post tweets using another way other than their API maybe using their implicit API used in the browser when you're posting from x.com. This could be tough but I might give it a shot anyway

Thank you for informing me ❤️. as this is the first time for this tool to reach that limit lol that's something I'm proud of but also the end of an exciting story.

Thanks.

mesb1 commented 3 months ago

Oh, sounds sad. Did i get it right, this is whole limit across allthe users?

I mean for example my limit was ended, and you also will be limited even if doing only one tweet for a whole day?

devhindo commented 3 months ago

Yeah I just tried it and I couldn't post. For all users. Funny.

devhindo commented 3 months ago

Your limit didn't end. The app itself is only allowed to post 50 tweets for all its current user. This is what Elon did when he bought Twitter. It was unlimited before.

mesb1 commented 3 months ago

Well, i assume there is a sense to add some limitation to the xcli then for local or server side.

We can share 50 tweets across 10 users for 5 posts per day for example.

I will stop my autoposter for tracks and will use this for some specific things like just random posts sometimes from server.

mesb1 commented 3 months ago

If you ever decide to move for some paid options for this api we can try to continue streamer data posting.

mesb1 commented 3 months ago

By the way, is it possible to create xcli2 xcli3 xcliN app for twitterconnection for making it about 50 requests each?

mesb1 commented 3 months ago

I will stop my autoposter for tracks and will use this for some specific things like just random posts sometimes from server.

FYI: I have reordered my automation scripts to make posting twice less with combination of two tracks data in one post. So let's see how it goes hope will not hit limits too fast.

Ping me if it is a problem and I will stop it again.

mesb1 commented 3 months ago

Just realized I can do even 3 times less. Will take a look today's evening.

mesb1 commented 2 months ago

Found small issue with my script and fixed it. Posts should be a bit less also.