Giter Site home page Giter Site logo

Comments (9)

nst avatar nst commented on June 19, 2024

I cannot reproduce the issue. I just tried with TweetDeck consumer tokens and XAuth and requested the user stream as you did. I immediately get a dictionary with a single 'friends' key. When the user posts something, I immediately receive the tweet. Please ensure to be using the latest version. Also, ensure your consumer tokens are allowed to use the streaming API. If it still doesn't work, please consider making a sample, minimal project that I can run and debug. Thank you.

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on June 19, 2024

Hmm. I'll check again, but setting it to @yES returns everything just fine, all replies of everybody included. Setting it to nil gets the same results as before. I'll report back when i try again.

from sttwitter.

nst avatar nst commented on June 19, 2024

In order to ease your tests, you may want to run this code:

STTwitterAPI *api = [STTwitterAPI twitterAPIWithOAuthConsumerKey:TWEET_DECK_CK
                                                  consumerSecret:TWEET_DECK_CS
                                                        username:USERNAME
                                                        password:PASSWORD];

[api verifyCredentialsWithSuccessBlock:^(NSString *username) {

    [api getUserStreamDelimited:@NO stallWarnings:@YES includeMessagesFromFollowedAccounts:nil includeReplies:nil keywordsToTrack:nil locationBoundingBoxes:nil progressBlock:^(id response) {
        NSLog(@"-- response: %@", response);
    } stallWarningBlock:^(NSString *code, NSString *message, NSUInteger percentFull) {
        NSLog(@"-- code: %@, message: %@", code, message);
    } errorBlock:^(NSError *error) {
        NSLog(@"-- error 2: %@", [error localizedDescription]);
    }];

} errorBlock:^(NSError *error) {
    NSLog(@"-- error 1: %@", [error localizedDescription]);
}];

This is what I get here:

2013-11-10 01:55:01.304 STTwitterDemoOSX[27454:303] -- response: {
    friends =     (
        108527800
    );
}
2013-11-10 01:55:12.841 STTwitterDemoOSX[27454:303] -- response: {
    contributors = "<null>";
    coordinates = "<null>";
    "created_at" = "Sun Nov 10 00:55:15 +0000 2013";
    entities =     {
        hashtags =         (
        );
        symbols =         (
        );
        urls =         (
        );
        "user_mentions" =         (
        );
    };
    "favorite_count" = 0;
    favorited = 0;
    "filter_level" = medium;
    geo = "<null>";
    id = 399339434098692096;
    "id_str" = 399339434098692096;
    "in_reply_to_screen_name" = "<null>";
    "in_reply_to_status_id" = "<null>";
    "in_reply_to_status_id_str" = "<null>";
    "in_reply_to_user_id" = "<null>";
    "in_reply_to_user_id_str" = "<null>";
    lang = und;
    place = "<null>";
    "retweet_count" = 0;
    retweeted = 0;
    source = web;
    text = asd;
    truncated = 0;
    user =     {
        "contributors_enabled" = 0;
        "created_at" = "Sun Mar 24 08:42:41 +0000 2013";
        "default_profile" = 1;
        "default_profile_image" = 0;
        description = "<null>";
        "favourites_count" = 1;
        "follow_request_sent" = "<null>";
        "followers_count" = 1;
        following = "<null>";
        "friends_count" = 1;
        "geo_enabled" = 1;
        id = 1294332967;
        "id_str" = 1294332967;
        "is_translator" = 0;
        lang = en;
        "listed_count" = 0;
        location = "";
        name = "nst022 test account";
        notifications = "<null>";
        "profile_background_color" = C0DEED;
        "profile_background_image_url" = "http://abs.twimg.com/images/themes/theme1/bg.png";
        "profile_background_image_url_https" = "https://abs.twimg.com/images/themes/theme1/bg.png";
        "profile_background_tile" = 0;
        "profile_image_url" = "http://pbs.twimg.com/profile_images/378800000192809050/6a5b12e3e227e4ca8afb2de89a416f2e_normal.gif";
        "profile_image_url_https" = "https://pbs.twimg.com/profile_images/378800000192809050/6a5b12e3e227e4ca8afb2de89a416f2e_normal.gif";
        "profile_link_color" = 0084B4;
        "profile_sidebar_border_color" = C0DEED;
        "profile_sidebar_fill_color" = DDEEF6;
        "profile_text_color" = 333333;
        "profile_use_background_image" = 1;
        protected = 0;
        "screen_name" = nst022;
        "statuses_count" = 34;
        "time_zone" = Amsterdam;
        url = "<null>";
        "utc_offset" = 3600;
        verified = 0;
    };
}

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on June 19, 2024

I tried the above in the demo project, replacing the keys with mine, and it still errors out. I do have the latest version of STTwitter. I also tried using the demo app's keys, and the same thing still happens.

Here is what's returned:

2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- regexError: (null)
2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- body: (null)
2013-11-09 20:32:48.299 STTwitterDemoiOS[5056:70b] -- error 2: The request timed out.

Am I missing something regarding how my app is supposed to be set up in Twitter's application settings?

from sttwitter.

nst avatar nst commented on June 19, 2024

The streaming API is not available to all applications, but you said your application was able to use it.

I uploaded a working test project using TweetDeck tokens http://seriot.ch/temp/STTwitterStreaming.zip.

You should get the stream after entering your login and password.

If it still doesn't work, then maybe you IP is temporarily banned for some reason. Try to print the response headers.

Also, maybe you have a special character in your password or something?

We'll find out :-)

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on June 19, 2024

I changed my password to the simplest password123 i could think of to eliminate special characters, ran the project after inserting my user/pass, and guess what? Same error! However, when i went back to my project and tried again, I managed to get two streamed tweets back, then the same error, running on device, on LTE (unlimited data, and not on my home network). I've made sure i'm not calling the method multiple times or anything like that, so I don't think it's an IP ban thing as wouldn't that also affect the stream where all replies are included? For the record, this is the error in full I get back

2013-11-10 10:08:21.113 Nightingale[780:60b] error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x181c82f0 {NSErrorFailingURLStringKey=https://userstream.twitter.com/1.1/user.json?stall_warnings=1&stringify_friend_ids=1&delimited=0, NSErrorFailingURLKey=https://userstream.twitter.com/1.1/user.json?stall_warnings=1&stringify_friend_ids=1&delimited=0, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x16e815f0 "The request timed out."}

Edit: Could it be an NSURLCache issue? I do have a cache set up in my app, but it should only cache images...
I'm also calling the streaming method in the completion block of the getHomeTimeline method. Would this be an issue?

from sttwitter.

nst avatar nst commented on June 19, 2024

Ok so I think the problem is not related to the includeReplies parameter but to the timeout parameter in STHTTPRequest which is, by default, set to 30 seconds. In fact, I've never waited for so long while testing the streaming API. I will remove this timeout for streaming requests. Meanwhile, you can set the kSTHTTPRequestDefaultTimeout value to zero and hopefully you won't get timeouts anymore. Thank you for spotting this issue and helping me to find out the cause.

from sttwitter.

nst avatar nst commented on June 19, 2024

I removed the timeout for all requests ac58d48.

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on June 19, 2024

Yes it's fixed! Thank you for your support, I would probably not have thought it was a timing problem! 👍

from sttwitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.