twitter: convert commentary to dtext.

* Convert hashtags and mentions to dtext links.
* Replace http://t.co urls to the actual url.
* Strip the http://t.co url linking to the tweet itself.
This commit is contained in:
evazion
2017-06-16 10:49:36 -05:00
parent 9909ff20cd
commit 5dd3151d5b
2 changed files with 29 additions and 0 deletions

View File

@@ -89,5 +89,17 @@ module Sources
end
end
end
context "A tweet" do
setup do
@site = Sources::Site.new("https://twitter.com/noizave/status/875768175136317440")
@site.get
end
should "convert urls, hashtags, and mentions to dtext" do
desc = 'test "#foo":[https://twitter.com/hashtag/foo] "#ホワイトデー":[https://twitter.com/hashtag/ホワイトデー] "@noizave":[https://twitter.com/noizave]\'s blah http://www.example.com <>& 😀'
assert_equal(desc, @site.dtext_artist_commentary_desc)
end
end
end
end