The web API madness continues: If you find yourself running out of space on Twitter, Tweetshrink has an API you can use to return a shortened string of whatever you pass to it. You can use this in tandem with the URL shortener and Twitter posting code to create a robust Excel-based Twitter application. I can't believe I just wrote "robust Excel-based Twitter application".
Function FixTweet(txt As String) As String
' based on http://tweetshrink.com/api
Dim xml As Object
Set xml = CreateObject("MSXML2.XMLHTTP.6.0")
xml.Open "POST", "http://tweetshrink.com/shrink?format=string&text=" & txt, False
xml.Send
FixTweet = xml.responsetext
End Function
Sample usage:
Sub TestShrink()
Debug.Print FixTweet("this is my tweet, I love it!")
End Sub
Follow Me