Hi Linvi,
First of all thank you very much for this AMAZING and SIMPLE Twitter API. It's absolutely brilliant! I am porting your whole API as a vvvv plugin dll. vvvv is a visual programming language similar to MAX/MSP or PURE DATA and is used mostly by creative coders and digital artists, it's also similar to OPENFRAMEWORKS.CC and TOUCHDESIGNER. Anyways I am making the ultimate vvvv twitter plug in which is effectively porting all features of your api to a vvvv plugin. I have had amazing success doing so and managed to port the whole search functionality but since vvvv is real-time coding I am looking at ASYNC search function to improve the plug in responsiveness.
SO, I am having trouble changing the twitter search function to async. I do apologise as I am not the best c# dev and i understand my lack of asynchronous c# programming doesn't help.
I am looking for an example of searchAsync function.
What i have is this (it works as it stands):
After defining some search parameters... I do this:
var tweets = Search.SearchTweets(searchParameter);
foreach(var tweet in tweets){
//DO LOTS OF STUFF, essentially populate a bunch of lists i have created with all tweet texts, //tweet author name, etc...
}
To change it to async search i try and do this...
Task<list<ITweet>> tweets = SearchAsync.SearchTweets(searchParameter);
or even simply the same: var tweets = SearchAsync.SearchTweets(searchParameter);
BUT THEN how do I loop through all results??? I am just simply trying to recreate the: foreach(var tweet in tweets){//DO THIS}
Is it just???
if(tweets!=null){//DO THIS}
Doesn't seem to work, effectively i am just trying to recreate the foreach but for async search function... If you could provide me with an example it would be much appreciated! Thank you again for everything. Peace
First of all thank you very much for this AMAZING and SIMPLE Twitter API. It's absolutely brilliant! I am porting your whole API as a vvvv plugin dll. vvvv is a visual programming language similar to MAX/MSP or PURE DATA and is used mostly by creative coders and digital artists, it's also similar to OPENFRAMEWORKS.CC and TOUCHDESIGNER. Anyways I am making the ultimate vvvv twitter plug in which is effectively porting all features of your api to a vvvv plugin. I have had amazing success doing so and managed to port the whole search functionality but since vvvv is real-time coding I am looking at ASYNC search function to improve the plug in responsiveness.
SO, I am having trouble changing the twitter search function to async. I do apologise as I am not the best c# dev and i understand my lack of asynchronous c# programming doesn't help.
I am looking for an example of searchAsync function.
What i have is this (it works as it stands):
After defining some search parameters... I do this:
var tweets = Search.SearchTweets(searchParameter);
foreach(var tweet in tweets){
//DO LOTS OF STUFF, essentially populate a bunch of lists i have created with all tweet texts, //tweet author name, etc...
}
To change it to async search i try and do this...
Task<list<ITweet>> tweets = SearchAsync.SearchTweets(searchParameter);
or even simply the same: var tweets = SearchAsync.SearchTweets(searchParameter);
BUT THEN how do I loop through all results??? I am just simply trying to recreate the: foreach(var tweet in tweets){//DO THIS}
Is it just???
if(tweets!=null){//DO THIS}
Doesn't seem to work, effectively i am just trying to recreate the foreach but for async search function... If you could provide me with an example it would be much appreciated! Thank you again for everything. Peace