As we expand our Twitter distribution we could definitely make use of some of this automation and community involvement would be pretty great. Just getting this on your radar.
Should probably point out that this implementation is quite fragile - if dev.to at some stage added an API interface it would make this sort of thing much more robust than the current scraping solution😉
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
Loved it. Awesome article. I’ve used puppeteer for automations like this before but it’s usually an overkill. I’ll try to replicate this by building a bot for React :) Thank you for the article.
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
Bot up and running on azure as well. The twitter profile is twitter.com/TheReactDev. I'll wrap it up tomorrow and put the code on GitHub. This stuff is fun!
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
One thing to note is that checking the extended_url didn't worked for me. Sometimes the twitter api handles me a twitter.com link instead of a dev.to link. Any ideas on why?
Do you mean the expanded_url in tweet.entities.urls? I didn't have this problem 🤔. If you get stuck feel free to put your code on GitHub and I'm happy to take a look!
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
Thanks. Yeah, I mean the tweet.entities.urls. For some posts it does not return the dev.to url but instead returns a twitter.com link to the own link. I ended up fetching the tweets on extended mode and checking the title + author on the full_text. Not great but, it works.
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
I found the problem. You have to ask for the tweets with tweet_mode: "extended" on the statuses/user_timeline endpoint, otherwise you don't always get the posted url. Might be a quirk of the twitter API, I'm not sure about it. Was writing about this when I finally understood the behavior. That's why writing about what you're doing is so important! 😄
Self-taught developer and OSS enthusiast. I'm specialized in Front End development but I don't miss a chance to do JS anywhere, whether it's a browser, a mobile device, a server or a robot.
As an educator, author and technologist, Jen Looper has over 24 years' experience as a web and mobile developer, specializing in creating cross-platform web & mobile apps.
Husband, father of 👧 👧, and software developer living in the Metro Detroit area. Interested in continuous learning, tinkering, and exploring new technology. LEARN.always
Nice!
CC: @peter @michaeltharrington
As we expand our Twitter distribution we could definitely make use of some of this automation and community involvement would be pretty great. Just getting this on your radar.
Should probably point out that this implementation is quite fragile - if dev.to at some stage added an API interface it would make this sort of thing much more robust than the current scraping solution😉
Duly noted. We have some endpoints
dev.to/api/articles?tag=vue
But they’re pretty scattered. We’ll have more order to the madness in the near future.
Loved it. Awesome article. I’ve used puppeteer for automations like this before but it’s usually an overkill. I’ll try to replicate this by building a bot for React :) Thank you for the article.
Thanks for the kind words; all the best with your bot!
Bot up and running on azure as well. The twitter profile is twitter.com/TheReactDev. I'll wrap it up tomorrow and put the code on GitHub. This stuff is fun!
One thing to note is that checking the
extended_url
didn't worked for me. Sometimes the twitter api handles me a twitter.com link instead of a dev.to link. Any ideas on why?Do you mean the
expanded_url
intweet.entities.urls
? I didn't have this problem 🤔. If you get stuck feel free to put your code on GitHub and I'm happy to take a look!@frontendwizard Just saw your React bot - it looks great! Especially like how you turned the dev.to tags into Twitter hashtags. Great work.
Thanks. Yeah, I mean the
tweet.entities.urls
. For some posts it does not return thedev.to
url but instead returns atwitter.com
link to the own link. I ended up fetching the tweets on extended mode and checking the title + author on thefull_text
. Not great but, it works.I found the problem. You have to ask for the tweets with
tweet_mode: "extended"
on thestatuses/user_timeline
endpoint, otherwise you don't always get the posted url. Might be a quirk of the twitter API, I'm not sure about it. Was writing about this when I finally understood the behavior. That's why writing about what you're doing is so important! 😄btw, the code is on Github now: github.com/thefrontendwizard/TheRe...
Thank you for this!
I was surprised to seeing this. idea is awesome
Great job not just on the idea, but bringing it to life! Proof its working:
An RSS feed! An RSS feed! My kingdom for an RSS feed!