Search Results

Search found 14767 results on 591 pages for 'twitter api'.

Page 14/591 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • When to use HTTP status code 404 in an API

    - by Sybiam
    I am working on a project and after arguing with people at work for about more than a hour. I decided to know what people on stack-exchange might say. We're writing an API for a system, there is a query that should return a tree of Organization or a tree of Goals. The tree of Organization is the organization in which the user is present, In other words, this tree should always exists. In the organization, a tree of goal should be always present. (that's where the argument started). In case where the tree doesn't exist, my co-worker decided that it would be right to answer response with status code 200. And then started asking me to fix my code because the application was falling apart when there is no tree. I'll try to spare flames and fury. I suggested to raise a 404 error when there is no tree. It would at least let me know that something is wrong. When using 200, I have to add special check to my response in the success callback to handle errors. I'm expecting to receive an object, but I may actually receive an empty response because nothing is found. It sounds totally fair to mark the response as a 404. And then war started and I got the message that I didn't understand HTTP status code schema. So I'm here and asking what's wrong with 404 in this case? I even got the argument "It found nothing, so it's right to return 200". I believe that it's wrong since the tree should be always present. If we found nothing and we are expecting something, it should be a 404. More info, I forgot to add the urls that are fetched. Organizations /OrgTree/Get Goals /GoalTree/GetByDate?versionDate=... /GoalTree/GetById?versionId=... My mistake, both parameters are required. If any versionDate that can be parsed to a date is provided, it will return the closes revision. If you enter something in the past, it will return the first revision. If by Id with a id that doesn't exists, I suspect it's going to return an empty response with 200. Extra Also, I believe the best answer to the problem is to create default objects when organizations are created, having no tree shouldn't be a valid case and should be seen as an undefined behavior. There is no way an account can be used without both trees. For that reasons, they should be always present. also I got linked this (one similar but I can't find it) http://viswaug.files.wordpress.com/2008/11/http-headers-status1.png

    Read the article

  • Should I use my own public API on my site (via JS)?

    - by newboyhun
    First of all, this question is far more different other 'public api questions' like this: Should a website use its own public API?, second, sorry for my English. You can find the question summarized at the bottom of this question. What I want to achieve is a big website with a public api, so who like programming (like me) and likes my website, can replicate my website's data with a much better approach (of course with some restrictions). Almost everything could be used by the public API. Because of this, I was thinking about making the whole website AJAX driven. There would be parts of the API which would be limited only to my website (domain), like login, registering. There would be only an INTERFACE on the client side, which would use the public and private API to make this interface working. The website would be ONLY CLIENT SIDE, well, I mean, the website would only use AJAX to use the api. How do I imagine this? The website would be like a mobile application, the application only sending a request to a webserver, which returns a json, the application parses it, and uses it to advance in the application. (e.g.: login) My thoughts: Pros: The whole website is built up by javascript, this means I don't need to transfer the html to the client, saving bandwidth. (I hope so) Anyone can use up the data of my website to make their own cool things. (Is this a con or pro? O_O) The public API is always in use, so I can see if there are any error. Cons: Without Javascript the website is unusable. The bad guys easily can load the server with requesting too much data (like Request Per Second 10000), but this can be countered via limiting this with some PHP code and logging. Probably much more work So the question in some words is: Should I build my website around my own api? Is it good to work only on the client side? Is this good for a big website? (e.x.: facebook, yeah facebook is a different story, but could it run with an 'architecture' like this?)

    Read the article

  • iPhone Twitter Integration: Validating login.

    - by Mr. McPepperNuts
    The following code posts to twitter: NSString *compoundLoginString = [NSString stringWithFormat:@"http://%@:%@@twitter.com/statuses/update.xml",extractedUsername, extractedPassword]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:compoundLoginString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; // The text to post NSString *msg = tweetText; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg] dataUsingEncoding:NSASCIIStringEncoding]]; NSURLResponse *response; NSError *error; if ([NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error] != nil){ [self postSuccessfulAlert]; }else{ [self postNotSuccessfulAlert]; } I am curious as to how I could check if the username and password is correct before proceeding to the above piece of code. I found the following code in a tutorial, but am unsure how I would implement or call this function. - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge previousFailureCount] == 0) { NSURLCredential *newCredential; newCredential=[NSURLCredential credentialWithUser:[self username] password:[self password] persistence:NSURLCredentialPersistenceNone]; [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge]; } else { [[challenge sender] cancelAuthenticationChallenge:challenge]; // inform the user that the user name and password // in the preferences are incorrect NSLog(@"Invalid Username or Password"); } } Any ideas? Please note, I have taken snippets of code from both of the following tutorials. http://iphonedevelopertips.com/networking/post-to-a-twitter-account-from-the-iphone.html and http://icodeblog.com/2009/07/09/integrating-twitter-into-your-applications/

    Read the article

  • Twitter friends timeline not returning full history

    - by twofivesevenzero
    I am using twitter4J to get a user's friends timeline, but it is not returning the full available history. I know there are pagination limits (200 per request and 3200 total as per http://bit.ly/ck8ysq) and I am well within those. I make a request like so: private static final int MAX_COUNT = 200; private List<Status> getAllStatuses(long sinceID) throws TwitterException { Twitter twitter = new Twitter(username, password); List<Status> friendsTimelineList = new ArrayList<Status>(); List<Status> tempList; int page = 0; do { page++; tempList = twitter.getFriendsTimeline( new Paging(page, MAX_COUNT, sinceID)); if(tempList == null ) break; friendsTimelineList.addAll(tempList); } while(true); return friendsTimelineList; } This results in only 423 statuses being returned across 3 pages. Any idea why this might be happening?

    Read the article

  • Is there a codeigniter api reference?

    - by ajsie
    whenever using a framework it's so good with a api reference so you could lookup the classes' methods and properties, which class they extend from and so on. is there a api reference for codeigniter similar to yii's excellent api referenc? http://www.yiiframework.com/doc/api/ how else could you know more about the details about the classes if there isn't a good api reference. java's api reference is also great: http://java.sun.com/j2se/1.4.2/docs/api/ why can't i find codeigniter's. thanks.

    Read the article

  • How to specify a SEO friendly url like twitter www.twitter.com/<name> using YII framework

    - by hip10
    Hi, I am currently using the Yii framework, and I would like to know if anyone has any clue on how to setup a SEO friendly url like www.twitter.com/ automatically in Yii? I know how to do so this manually in the config/main.php but I would like to be able to dynamically generate it. I have been able to do it in Grails as well. In Yii, what I know of is that you need to have another parameter like www.twitter.com/l/, but I do not want that parameter, anyone can share? Thanks.

    Read the article

  • Twitter Like Software for Corporations

    - by joe
    Is there microblogging software that companies can host internally? I think I remember Joel Spolsky mentioning that Fog Creek uses one. I can't remember what the name was or find what other software is out there. Does anyone have any ideas?

    Read the article

  • Tweeple some general questions about twitter

    - by Peter
    1) If I tweet to someone who is not my friend/follower does he receive my tweets? What if I select 'protect my tweets' option in my profile? 2) Can someone who is not my friend/follower send me a tweet? What if I select 'protect my tweets' option in my profile?

    Read the article

  • Which twitter client can synchronize unread tweets?

    - by Tom Burger
    Right now I'm forced to read all the tweets in a single client on a single device (TweetDeck on my Android phone). If I would switch to another device and/or client, I would need to search for the last unread tweet, which is sometimes complicated (too many tweets). So, the question: Is there a client who can keep the status (read/unread) on tweets across multiple devices? My target systems would be now Android and MS Windows, but also Linux might be handy.

    Read the article

  • Which twitter client can synchronize unread tweets?

    - by Tom Burger
    Right now I'm forced to read all the tweets in a single client on a single device (TweetDeck on my Android phone). If I would switch to another device and/or client, I would need to search for the last unread tweet, which is sometimes complicated (too many tweets). So, the question: Is there a client who can keep the status (read/unread) on tweets across multiple devices? My target systems would be now Android and MS Windows, but also Linux might be handy.

    Read the article

  • 401 Unauthorized using oauth with twitter on iPhone

    - by menkel
    I use Twitter-OAuth-iPhone. http://github.com/bengottlieb/Twitter-OAuth-iPhone/ when i try to login on twitte, I received an error 401 i received the delegate call for - (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username { but when i try to send a tweet just after [_engine sendUpdate: [NSString stringWithFormat:@"Hello World"]]; i received an error 401 failed with error: Error Domain=HTTP Code=401 "Operation could not be completed. (HTTP error 401.)" i have check my twitter application setting Type: Client Default Access type: Read & Write

    Read the article

  • Twitter oauth authorization in a pop-up instead of in main browser window

    - by niyogi
    I feel incredibly stupid for even asking this since the answer might already be under my nose but here it goes: TweetMeme has a Re-tweet twitter widget that publishers can place on their blogs. When a user clicks on the widget, it pops open a window which allows the user to authenticate themselves with twitter and then re-tweet. This seems to use some special Twitter oauth popup form factor - unless there is something fancier happening under the surface to authenticate the user. The pop-up window looks like this: http://twitpic.com/1kepcr I'd rather handle an authentication via a pop-up rather than send the user to a brand new page (for the app I'm working on) and they seem to have the most graceful solution. Thoughts on how they did this?

    Read the article

  • Get json from Twitter API in iPhone using JSON Framework

    - by jozei
    Hello now I'm trying to get json data from Twitter API using iPhone. I'm using JSON Framework. This code has good results. #import "JSON/JSON.h" NSString *urlString= @"http://api.twitter.com/1/statuses/public_timeline.json"; NSURL *url = [NSURL URLWithString:urlString]; NSString *jsonString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; NSLog(@"%@", jsonString); But when I change API's URL like "http://search.twitter.com/trends/current.json" the above code gets SIGABRT error. Could someone explain it to me? Thanks.

    Read the article

  • Difficulties signing in to Twitter from iPhone

    - by Tristan
    Hi there, I'm using MGTwitterEngine to add Twitter functionality to my app. It's very easy to simply prompt the user for a username and password and then start posting. Strangely, however, I've noticed other apps (eg Foursquare and Brightkite) require you to visit their website to associate your Twitter account with your foursquare/brightkite/whatever account. Why do they do it this way? Is there a reason why my app shouldn't prompt the user for a Twitter username and password, even though it would be so easy? Thanks a bunch! Tristan

    Read the article

  • iOS6 Twitter integration

    - by Peter Warbo
    There seems to be a difference between the iPhone simulator and actual device when checking if Twitter is available. I check if a Twitter account is setup by using this code: [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]; In the simulator there is a nice UIAlertView informing the user that there are no Twitter accounts setup and two buttons one for Settings and one for Cancel. However when I run my app on my device it will not show the above UIAlertView. Why is that? And how can I catch what button is tapped in the above UIAlertView (since I did not instantiate it?) This is what it looks like on the simulator:

    Read the article

  • Twitter API and rate limiting - I am confused

    - by jeffreyveon
    I am new to the Twitter API, and I looked at their whitelisting policies and I am a little confused... I'm basically writing a twitter aggregrator that crawls the public tweets of a set of users (not more than 200) hourly. I wanted to apply for whitelisting, and they seem to offer account based and IP based whitelisting. Since I am using a shared hosting, my outbound IP address might vary (and twitter does'nt allow IP ranges for whitelisting). So I am considering using account based whitelisting. However, while using OAuth, is it possible for me to use account based whitelisting for a background process that crawls the API hourly?

    Read the article

  • Twitter OAuth question

    - by Squall
    Hi there, I'm making a Twitter client in Java, and I've came to a problem I don't know how to solve it. How the hell I store open auth for twitter? I mean it doesn't make very sense for a person to allow an application every time he wants to use the client. I've been look at the Twitter documentation, but I must say, it's really poor in terms of Java. So do you guy have some idea to solve this? Thanks in advance!

    Read the article

  • Twitter oauth php problems

    - by Patrick Gates
    I'm writing some backend script for a twitter app and heres how it's going On the app you click a button that sends you to login.php on my server which logs into my database connects to twitter with my consumer key and secret: $to = new TwitterOAuth($consumer_key, $consumer_secret); $tok = $to->getRequestToken(); $request_link = $to->getAuthorizeURL($tok); and then writes the token and secret to the database, sets a session equal to the id in the database of the token and secret and then redirects to the "$request_link" You then go through the process of logging in and such on twitter and it redirects you to callback.php on my server Callback.php consists of logging into the database again, getting the new token and secret, and then writing the new token and secret to the database and then prompts you to go back to the app Then on the app, all I'm trying to do is access the basic credentials$to->get('account/verify_credentials') and it keeps coming back "could not authenticate you" What am I doing wrong?? Thank you for all the help :)

    Read the article

  • second time auto login to twitter using oauth php

    - by JAMES
    Any can tell me how to second time auto connect with twitter from my site. I did... the following CODE if(empty($outh_key_db)){ $token=$_SESSION['oauth_token'] ; $outh_secr_db=$_SESSION['oauth_token_secret']; $con = mysql_connect("localhost","rathin","xxxxxxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_twtbook", $con); mysql_query("UPDATE register SET outh_key = '".$token."', outh_secr='".$outh_secr_db."' WHERE userid='".$loguser_email."'"); mysql_close($con); This code save the outh_token and outh_tk_secret to my DB. But on second time log in to my site I passed the 'outh_token and outh_tk_secret' in session with username. The oauth not authenticate that.... Kindly suggest me.... to make aouth connect to twitter using oauth...if user once(1st time made the) connect twitter

    Read the article

  • facebook and twitter buttons doesn't work

    - by Justin
    I am building a website in dreamweaver cs5. for some reason, the facebook like button and twitter share as well as follow button doesn't work. facebook like button shows nothing. (in the area, chrome says page cannot be found), twitter buttons show the hyperlink tweet and it tweets but the icon doesn't show up. The code for both are generated from facebook and twitter itself. I haven't hosted the site yet. I and coding and previewing it. Is that the reason for them not to work? I also tried addthis.com widget. It didn't show up as it should have. Please help! Many thanks.

    Read the article

  • Implementing synchronous MediaTypeFormatters in ASP.NET Web API

    - by cibrax
    One of main characteristics of MediaTypeFormatter’s in ASP.NET Web API is that they leverage the Task Parallel Library (TPL) for reading or writing an model into an stream. When you derive your class from the base class MediaTypeFormatter, you have to either implement the WriteToStreamAsync or ReadFromStreamAsync methods for writing or reading a model from a stream respectively. These two methods return a Task, which internally does all the serialization work, as it is illustrated bellow. public abstract class MediaTypeFormatter { public virtual Task WriteToStreamAsync(Type type, object value, Stream writeStream, HttpContent content, TransportContext transportContext); public virtual Task<object> ReadFromStreamAsync(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger); }   .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } However, most of the times, serialization is a safe operation that can be done synchronously. In fact, many of the serializer classes you will find in the .NET framework only provide sync methods. So the question is, how you can transform that synchronous work into a Task ?. Creating a new task using the method Task.Factory.StartNew for doing all the serialization work would be probably the typical answer. That would work, as a new task is going to be scheduled. However, that might involve some unnecessary context switches, which are out of our control and might be affect performance on server code specially.   If you take a look at the source code of the MediaTypeFormatters shipped as part of the framework, you will notice that they actually using another pattern, which uses a TaskCompletionSource class. public Task WriteToStreamAsync(Type type, object value, Stream writeStream, HttpContent content, TransportContext transportContext) {   var tsc = new TaskCompletionSource<AsyncVoid>(); tsc.SetResult(default(AsyncVoid));   //Do all the serialization work here synchronously   return tsc.Task; }   /// <summary> /// Used as the T in a "conversion" of a Task into a Task{T} /// </summary> private struct AsyncVoid { } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } They are basically doing all the serialization work synchronously and using a TaskCompletionSource for returning a task already done. To conclude this post, this is another approach you might want to consider when using serializers that are not compatible with an async model. Update: Henrik Nielsen from the ASP.NET team pointed out the existence of a built-in media type formatter for writing sync formatters. BufferedMediaTypeFormatter http://t.co/FxOfeI5x

    Read the article

  • Pan point on Google Map to specific pixel position on screen (API v3)

    - by Jake
    When overlay is a Google maps overlay and offsetx, offsety is the pixel distance from the maps center that I want to pan latlong to, the following works. var projection = overlay.getProjection(); var pxlocation = projection.fromLatLngToContainerPixel(latlong); map.panTo(projection.fromContainerPixelToLatLng(new google.maps.Point(pxlocation.x+offsetx,pxlocation.y+offsety))); However, I don't always have an overlay on the map and map.getProjection() returns a projection, not a MapCanvasProjection which does not have the methods I need. Is there a way to do this without making an overlay specificaly for it?

    Read the article

  • gdata api + javascript library for accessing documents?

    - by user246114
    Hi, I wanted to do the following with the gdata javascript library: get a list of a user's documents. read the contents of a chosen document. edit its contents, update the document. If I'm reading correctly, this is not supported by the javascript library? I got this to work with the java library, but would like to push this functionality to the client. Is it possible? If not, are there any ways around it? Thank you

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >