Comments (5)
remove_first_occurrence()
does an indexOf()
substring search - presumably screen_name
in tweet.entities.user_mentions
is lower-cased?
Probably it would be better to use the indices
from that to decide what to delete instead.
from bbcmicrobot.
I'm happy to try to come up with a patch for this if that would be useful, but I think I'd really need a dump of the JSON from a sample tweet to test with (ideally one with multiple users mentioned).
from bbcmicrobot.
This continues to trip people up from time to time so would be good to fix.
@8bitkick Can you easily capture the JSON for a tweet with multiple users mentioned? I could write a patch without one, but it'd be easier with a real input to test against.
from bbcmicrobot.
here's JSON for https://twitter.com/bbcbasicbot/status/1297027193743310851?s=20
{"created_at":"Sat Aug 22 04:25:55 +0000 2020","id":1297027193743310800,"id_str":"1297027193743310851","text":"@BBCBasicBot @BBCMicroBot @Rheolism 10 REM TEST","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"bbcbasicbot","name":"Acorn Arc (1987) - BETA BOT","id":894268101985878000,"id_str":"894268101985878016","indices":[0,12]},{"screen_name":"bbcmicrobot","name":"BBC Micro 🦉 bot","id":1225968288842182700,"id_str":"1225968288842182657","indices":[13,25]},{"screen_name":"rheolism","name":"rheolism","id":1227667955539800000,"id_str":"1227667955539800064","indices":[26,35]}],"urls":[]},"source":"<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":894268101985878000,"in_reply_to_user_id_str":"894268101985878016","in_reply_to_screen_name":"bbcbasicbot","user":{"id":894268101985878000,"id_str":"894268101985878016","name":"Acorn Arc (1987) - BETA BOT","screen_name":"bbcbasicbot","location":"","description":"10 PRINT\"Runs your tweet on the 1st ARM-based computer\"\n20 PRINT\"Emulated on a Pi 4. Try BBC BASIC V\"\n30 GOTO 10\nBy @bbcmicrobot makers. Unofficial.","url":null,"entities":{"description":{"urls":[]}}},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":1,"favorited":false,"retweeted":false,"lang":"en"}
`
from bbcmicrobot.
thanks sorry for the delay....
from bbcmicrobot.
Related Issues (13)
- PNG output? HOT 16
- Tokenize parse error kills client HOT 2
- CI with test fails reported as passing HOT 1
- Handling of MODE7 colour blending HOT 4
- GXR and beebjit HOT 12
- Reduce start latency to match owlet HOT 2
- User Guide review HOT 2
- Stop loading DFS
- URLs npm prefers to use for jsbeeb break CI HOT 25
- Strip mastodon tags and mentions properly
- Emulator stops when focus switches away from tab HOT 1
- user guide links to interactive tutorial that links to Twitter...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbcmicrobot.