How can I get the array of which one favorite my tweets?


#1

I want to know which man favorite my tweets. And I used this method ----getStatusesActivitySummaryForStatusID.
but error happened.
error Domain=STTwitterTwitterErrorDomain Code=220 “Your credentials do not allow access to this resource” UserInfo={NSLocalizedDescription=Your credentials do not allow access to this resource}


#2

What API method is that using? The only Google result for getStatusesActivitySummaryForStatusID is this post.


#3

Is this using the STTwitter Objective-C library?

Do you have valid credentials?

Can you share any additional code (not the consumer key/secret) that demonstrates this issue?


#4

I used the STTwitter API.

there is a method to get favorites:

// GET statuses/:id/activity/summary.json

  • (NSObject *)_getStatusesActivitySummaryForStatusID:(NSString *)statusID
    successBlock:(void(^)(NSArray *favoriters, NSArray *repliers, NSArray *retweeters, NSInteger favoritersCount, NSInteger repliersCount, NSInteger retweetersCount))successBlock
    errorBlock:(void(^)(NSError *error))errorBlock;

this is the url:
NSString *resource = [NSString stringWithFormat:@“statuses/%@/activity/summary.json”, statusID];

this is the error message:
error Domain=STTwitterTwitterErrorDomain Code=220 “Your credentials do not allow access to this resource” UserInfo={NSLocalizedDescription=Your credentials do not allow access to this resource}


#6

This is not a public URL endpoint. Where did you find that documented? You won’t be able to use it, and the error you’re seeing is the expected behaviour.


#7

Those endpoints are explicitly marked as Twitter private endpoints in STTwitter, those are only implemented for completeness and research purpose, you can’t use those with your App.


#8

According to the STTwitter readme, this code should be a working sample of getting Favourites for a Tweet?


#9

In theory yes, but that private endpoint seems to be not accessible anymore even with OS X Twitter authentication (getting “Client is not permitted to perform this action.”)


#10

I hadn’t checked the code in detail, thanks. Definitely don’t call non-public endpoints.


#11

I had understood that this endpoint didn’t work.
However, I do want to know who is my best friend which favorite me most or retweet me most.
Do you know how to get this information in other way?


#13

You can use the Streaming API to listen for favourite and retweet events and keep a count of them.