api

How to implement a stateless REST API

I am working on a REST API that will be used by developers writing mobile apps. Users will be able to use 3rd party services (Google, Twitter etc) to authenticate themselves, this is mainly handled by OAuth (depending on the service in question). We use 2-legged OAuth between the client application and the API Server (where the consumer ...

Facebook API - Accessing a users album and using a photo

If extended permissions have been granted to the app to access a users albums, is it at all possible to display a selector where the user can choose one of their photos and then upload that photo to my website via a form submission? ...

Berkeley DB with Perl API, can't open existing database

This is very perplexing, but I'm having this weird error. Here's the code I have: my $env = new BerkeleyDB::Env ( -Home => "$dbFolder", -Flags => DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL | DB_CDB_ALLDB ) or die "cannot open environment: $BerkeleyDB::Error\n"; my $unsortedHash = BerkeleyDB::Hash->new ( -Filename => "Uns...

How should I deal with object hierarchies in a RESTful API?

Hi I am currently designing the API for an existing PHP application, and to this end am investigating REST as a sensible architectural approach. I believe I have a reasonable grasp of the key concepts, but I'm struggling to find anybody that has tackled object hierarchies and REST. Here's the problem... In the [application] business ...

mapping location to a time zone

I need to get the time zone for a given address/location. Assume that the address/location can be reverse geocoded (using google) to a lat/lng if necessary. This means that I may not have a zip code. I was really hoping that google provided some kind of API for this, but it seems that they don't. At a minimum you can google search fo...

Is it advisable to send/return data in .plist format to/from an API being accessed via iOS?

We're deciding between using JSON vs. Property List (binary) for our API, which will be accessed by iPhone/iPad/iPod Touch. Are there any speed advantages? ...

Booking API for Hotel , flight, Cruies

Hi everyone, I have to impliment Flight,Hotel and cruies booking in a travel site, But i have no idea that it will be done through any API or how? Can any one give me Idea Thanks ...

How to design a C++ API

I'm fairly new to advanced C++ program techniques such as templates, but I am developing a simple API for a project I'm working on. The function or method that you call can take a long time to complete. Essentially it's transferring a file over the network. It looks a bit like this. Client { int WriteFile(); int ReadFile(); } B...

Running Facebook Connect on localhost

Hi, I can't run facebook connect on localhost. I am using app-engine on pydev. I configured the site in facebook to : http://localhost:8080 but it returns an error : API Error Code: 100 API Error Description: Invalid parameter Error Message: next is not owned by the application. Is there a way to work with facebook on localhost? Tha...

Automatic face detection using Picasa API to extract individual images.

(A similar question has been asked on superuser for answers related to applications. The question is posted here to gather programmable solutions for the same) At my work place, passport sized photographs are scanned together, then cut up into individual pictures and saved with unique file numbers. Currently we use Paint.net to manually...

Facebook API - FQL get wall of fan page

Hey guys, In PHP im trying to get all the posts on a wall of a particular fan page which includes the fan's post and also the fans of that page posts. Does anybody know how to do it? i keep on getting Error Exceptions?! MY FQL query is currently SELECT post_id, viewer_id, actor_id, message, attachment, comments, likes, privacy, i...

Historical aggregate Twitter data

Hi, I want to graph the number of tweets and the number of followers over the last three months, but I haven't been able to find a way to do that either through the API or any ready-made tool. I tried TwitterCounter, but the data they provided was basically the result of some sort of interpolation function, not based on actual historic...

How to update status with myspace python api

I'm using myspace python api to post update status, but its return 401, Can't figure it out ,How to deal with that. ...

Facebook api status updates and the 'share' link

I have been updating status messages from my site to my clients facebook pages or fan pages using the PHP sdk like this $facebook = new Facebook('facebookApiKey', 'facebookAppSecret'); $facebook->api_client->users_setStatus($statusText, $facebookUid); When the status is posted and it shows up in my news feeds, I only have an option...

Garb request to Google Analytics fails from home ISP, but works elsewhere.

I'm trying to use the garb gem to access data from the Google analytics API and find that http requests using garb work just fine from a Linode account, but are refused from home (Comcast). Is Google rejecting some kinds of http requests from certain ISPs, or am I just doing something wrong? Simple example is below: require 'garb' Ga...

Why an InputStream obj cannot be nested into a BufferedReader obj directly?

An OutputStream obj can be connected into a PrintWriter obj directly, e.g., //either is OK new PrintWriter(socket.getOutputStream()); new PrintWriter(new OutputStreamWriter(socket.getOutputStream())); But in the case of an InputStream obj, it must be connected to a BufferedReader obj through an InputStreamReader obj, that is, new Buff...

Unable to open the stream comming from google map api in android?

When i am using below url for drawing route on map on android: StringBuilder urlString = new StringBuilder(); urlString.append("http://maps.google.com/maps?f=d&hl=en"); urlString.append("&saddr="); urlString.append(src); urlString.append("&daddr=");// to urlString.append(dest); urlString.append("&ie=UT...

how to use youtube-g ruby gem?

Hi all, new to rails and trying to get youtube-g to work... I am having a difficult time passing a users search from the form_tag to the controller.. for example: user lands on page, enters - tiger videos - in text_field_tag controller takes - tiger videos - and searches user lands on another page displaying the results... user lands ...

Downloading a webpage using urllib2 results in garbled junk? (only sometimes)

How come I hit this webpage, I get HTML text: http://itunes.apple.com/us/app/mobile/id381057839 But when I hit this webpage, I get garbled junk? http://itunes.apple.com/us/app/mobile/id375562663 I use the same download() function in python, which is here: def download(source_url): try: socket.setdefaulttimeout(10) ...

Import hotmail friend's emails in asp.net application.

Hi, I am build an application to import my friend list from my hotmail accounts. I tired to find out exact solution. Most of the links provide solution, but no one is work. Can any one give me more information about this. Thanks in advance. Imad ...