How to get the id of the tweet just post ?

Jul 24, 2014 at 5:46 PM
Edited Jul 24, 2014 at 5:47 PM
Hi,
Does anyone know how to get the twitter id of the tweet just after posting it using
  • Tweet.PublishTweet("text of the tweet") ?
  • TweetAsync.PublishTweetWithMedia("text of the tweet", file) ?
Thanks for your help ;)

PS : i'm using vb.net but any language sample could help me ;)

Seb
Coordinator
Jul 25, 2014 at 12:56 AM
Hi,
var tweet = Tweet.PublishTweet("salut");
var tweet = await TweetAsync.PublishTweet("salut");

var tweetId = tweet.Id;
Linvi
Jul 25, 2014 at 9:58 AM
Edited Jul 25, 2014 at 10:08 AM
Thanks :)

I 've just tried with TweetAsync.PublishTweetWithMedia("text of the tweet", file) ...
But it seems to return "1" ..., not the real id on twitter.
Perhaps i need to add a certain namespace to get it work ?

But i think it's because i didn't use await... (VB.net Server error #BC37057 saying that await can only be used with an async method) In that case, is there a way to mark TweetAsync.PublishTweetWithMedia as async ?
Jul 25, 2014 at 11:04 AM
Edited Jul 25, 2014 at 11:05 AM
Works well with Tweet.PublishTweetWithMedia , so it's ok for me now.
Thanks again,
Seb
Coordinator
Jul 25, 2014 at 3:13 PM
Hi there,

Are you working with a Windows 8 / Windows Phone 8 app or a simple console?
You need to use a project that is compatible with the async/await keywords.

Linvi
Jul 25, 2014 at 3:24 PM
Hi again,
My app is a web one, in asp.net (vb) on a IIS server.
In fact, await can't be used for me because in a loop for...next ;)
Thanks for your library that i added to my main program to be able to post medias :)
Marked as answer by linvi on 7/29/2014 at 6:00 AM