I'm trying to show just favourite tweets for a given user, but I've not managed to find how to do it.
Using TwitterServive GetUserTimeline is always returning empty, I'm guessing because the account never actually tweets. I just want a list of tweets that have been favourited by this account.
Any help would be appreciated, I'm sure it must be simple really, I just can't see how at the moment.
Well I did some Googling, but as I couldn't see an obvious way of doing it using the Skybrud methods.
That said, I just had an epiphany and discovered that it's easy to get the list of favourites for the currently aunthenticated user, even if I can't easily see if for other screen names.
Just means I need to re-autheticate as the account that I want the favourites for, which it will be when the site goes live anyway.
Mark,
it looks like there's been a glitch in our.umbraco, and I'm sorry but I didn't see that you were on a particular topic area for Skybrud.Social. Apologies for the mix-up - I thought that this was a general question you had put out there.
Mark
that looks like something we could use.
Any chance you could post a bit more detail when you've finished?
We tend to create a list on a Twitter account, which we then pull into a feed.
But this gets everything for the accounts on the list (use Tweetdeck to add the Twitter account with the list to the list).
This is not something that has been implemented in Skybrud.Social yet. But by utilizing some of the existing classes, you can get the favorites like:
// Declare the query string (eg. for specifying the count/limit)
NameValueCollection query = new NameValueCollection();
query.Add("count", "200");
// Make a raw request using the OAuth client since getting the favorites isn't actually supported yet in Skybrud.Social
SocialHttpResponse rawResponse = service.Client.DoHttpGetRequest("https://api.twitter.com/1.1/favorites/list.json", query);
// Parse the raw response into an strongly typed response
TwitterTimelineResponse response = TwitterTimelineResponse.ParseResponse(rawResponse);
foreach (var tweet in response.Body) {
<p>@tweet.Text</p>
}
This will give you the 200 most recent favorites of the authenticated user.
If you want to get the favorites of specific users - eg. by their screen name, you can use the example below instead:
// Declare the query string (eg. for specifying the count/limit)
NameValueCollection query = new NameValueCollection();
query.Add("count", "200");
query.Add("screen_name", "enter the screen name here");
// Make a raw request using the OAuth client since getting the favorites isn't actually supported yet in Skybrud.Social
SocialHttpResponse rawResponse = service.Client.DoHttpGetRequest("https://api.twitter.com/1.1/favorites/list.json", query);
// Parse the raw response into an strongly typed response
TwitterTimelineResponse response = TwitterTimelineResponse.ParseResponse(rawResponse);
foreach (var tweet in response.Body) {
<p>@tweet.Text</p>
}
Show favourite tweets for user
I'm trying to show just favourite tweets for a given user, but I've not managed to find how to do it.
Using TwitterServive GetUserTimeline is always returning empty, I'm guessing because the account never actually tweets. I just want a list of tweets that have been favourited by this account.
Any help would be appreciated, I'm sure it must be simple really, I just can't see how at the moment.
Thanks in advance..
Mark
Mark see the link below for how to do Twitter feeds, then build your own user control to display them on a page. https://dev.twitter.com/web/embedded-timelines
However, I would say your query lies in the "let me google that for you" category :-D
Well I did some Googling, but as I couldn't see an obvious way of doing it using the Skybrud methods. That said, I just had an epiphany and discovered that it's easy to get the list of favourites for the currently aunthenticated user, even if I can't easily see if for other screen names.
Just means I need to re-autheticate as the account that I want the favourites for, which it will be when the site goes live anyway.
Job done.
Thanks
Mark
Mark, it looks like there's been a glitch in our.umbraco, and I'm sorry but I didn't see that you were on a particular topic area for Skybrud.Social. Apologies for the mix-up - I thought that this was a general question you had put out there.
Mark that looks like something we could use. Any chance you could post a bit more detail when you've finished? We tend to create a list on a Twitter account, which we then pull into a feed. But this gets everything for the accounts on the list (use Tweetdeck to add the Twitter account with the list to the list).
Plus, it saves me Googling...
Hi Mark,
This is not something that has been implemented in Skybrud.Social yet. But by utilizing some of the existing classes, you can get the favorites like:
This will give you the 200 most recent favorites of the authenticated user.
If you want to get the favorites of specific users - eg. by their screen name, you can use the example below instead:
Hi MuirisOG / Anders,
I'm simply doing the following now, which appears to be working, though like I said above, only fr the authenticated user:
And our.umbraco does seem to be playing up a it, you're right..
It looked to me like I was in the wrong forum earlier, then when I came back it looked ok. I currently can't see anyone's karma or anything either..
Oh well, luckily I'm not easily offended or wound up ;-)
is working on a reply...