Resolving URLs from a URL shortening service in Java
So, in my efforts to create a tool to keep a (complete) archive of my Twitter activity, I today wrote a tool to help replace t.co URLs in my tweets, with the actual URL, here:https://github.com/morphex/twitter-exporter/commit/3341f7780...
Now I come from the Python world, and lately I've been looking at Java to learn it properly. To improve my chances of having gigs that are interesting, regardless of programming language.
I started looking at URL objects and generating a connection from that, but since I'm going to resolve a lot of t.co addresses, found that it would be better if I kept an HTTPS connection open to the t.co server, and then pass the final part of the URL over to t.co. Another issue here is maybe a "resting period" between each resolved URL, so as to not appear "spammy" or "resource hogging" on the t.co server.
Anyway, luckily I found an example online that I could adapt for my purposes, and I'd have to say, compared to Python, Java is a bit bureacratic with its classes and types, but other than that, Java is just fine.
[Permalink] [By morphex] [A Java-based tool to export tweets from Twitter for safe keeping (Atom feed)] [01 Apr 12:05 Europe/Oslo]