robertoszek / pleroma-bot

Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon/Misskey.
https://robertoszek.github.io/pleroma-bot
MIT License
104 stars 18 forks source link

Fix link to bird site #117

Closed wzyboy closed 1 year ago

wzyboy commented 1 year ago

Currently the link to bird site is in the format of:

https://twitter.com/i/web/status/12345

This link is registered but ironically unrecognised by Twitter for Android.

Twitter does not care about the user part of the URL, so:

https://twitter.com/{anything}/status/12345

... works.

This PR replaces the i/web part with _.

codecov[bot] commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (7de21ef) compared to base (9a64891). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #117 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 12 12 Lines 1993 1993 ========================================= Hits 1993 1993 ``` | [Impacted Files](https://codecov.io/gh/robertoszek/pleroma-bot/pull/117?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [pleroma\_bot/\_processing.py](https://codecov.io/gh/robertoszek/pleroma-bot/pull/117?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGxlcm9tYV9ib3QvX3Byb2Nlc3NpbmcucHk=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

robertoszek commented 1 year ago

Huh, good find!

I don't use Twitter for Android and I wouldn't have guessed this URL formatting would make it misbehave in any way.

I was a bit concerned this could break Nitter links but they seem to behave in the exact same way:

https://nitter.net/_/status/12345

Nice unconventional solution 👍

Thank you for your contribution!

wzyboy commented 1 year ago

I've been using the trick of _ as username for many years in my other Twitter-related toy projects and scripts as well. It saves a lot of trouble trying to figure out the screen_name of a tweet.

Ironically, previously in Twitter Archive there is screen_name field but a few years ago they removed the entire user dict, so given a tweet it's hard to determine the screen_name of the author. That's why I use _ myself :joy: