News for hackers. Stuff that matters.
Re:Twitter-text: libraries for identifying URLs, at mentions... by tawrahim on Sunday June 07, 2015 @08:55AM (#9674463)
I wrote a hashtag extractor for a project am working but I have to admit that I am particularly impressed with the robustness of the regex! I am definitely going to use some aspects of this code.
Re:Twitter-text: libraries for identifying URLs, at mentions... by glutamate on Sunday June 07, 2015 @10:38AM (#9674770)
Is it possible to do something like this with PostgreSQL's full text search? When I convert a search query containing an @mention or #hashtag with to_tsvector, I get matches for strings that aren't preceeded by # or @.
Re:Twitter-text: libraries for identifying URLs, at mentions... by eknkc on Sunday June 07, 2015 @10:01AM (#9674630)
Have been using the Js version for around 2 years to display tweets that we fetched from twitter api. If you have a similar use case, definately look into these.
Re:Twitter-text: libraries for identifying URLs, at mentions... by ninebrows on Sunday June 07, 2015 @10:31AM (#9674743)
Does twitter api matter anymore? I stopped using it a while back. I think stuff like this is helpful to businesses who buy their data.
Re:Twitter-text: libraries for identifying URLs, at mentions... by ville on Sunday June 07, 2015 @11:42AM (#9675052)
I found twitter-text useful for linkifying URLs in a chat application (not related to Twitter) that I built a couple of years ago.

The URL extraction functions are quite robust and handled the task well. This library has use cases beyond just parsing Twitter tweets.

Re:Twitter-text: libraries for identifying URLs, at mentions... by lewisl9029 on Sunday June 07, 2015 @02:45PM (#9675866)
Yep. This is exactly the use case I had in mind when I was looking for a library like this. These features are useful in all kinds of social/chat apps that need to convert users' plaintext messages into rich multimedia content.

Identifying things in plaintext is one of those things that seems very simple but ends up being a pain to get right if you want it to be robust enough to handle all the corner cases.

There's a reason why this library has over 2k commits! I'd hate to have to rediscover all the lessons they must have learned the hard way...

Re:Twitter-text: libraries for identifying URLs, at mentions... by charlieegan3 on Sunday June 07, 2015 @11:51AM (#9675094)
Doesn't the API already expose these as fields? https://dev.twitter.com/rest/reference/get/statuses/show/%3A...