Using web API directly into the processing

edited February 2015 in How To...

Hi Everyone, Is it possible to use web API directly into the processing? I know there are some libraries which can help me to fetch data from Flicker, twitter etc but can I do it without using any library, just by their API ? I was trying to fetch Facebook data such user album, likes, latest updates etc. I was also trying to fetch user's current location and whether using Google MAP API.

One thing I learned that using Facebook with processing is now became more difficult.

Here is one website which shows how to use web API with processing but I couldn't understand how to use it with Google API or FB. website

The REST API: It is now really difficult to find example of rest API with processing and I don't even know if processing still supports it. Even if it doesn then how to use it the REST API for Google MAPs and FB.

Such as

  1. Google Location API 1
  2. Google Location API 2

Comments

  • Search for the Client class from the Network library, we posted examples of its usage in the past. Search from the main site, not from the forum, it gives wider results.

  • edited February 2015

    @PhiLho, Thanks for the reply. Can you please post some of the examples if you don't mind? I have tried to search using processing website but I couldn't find any post in old or new forum.

  • @PhiLho thank for the links and great collection btw. I just need a small piece of help. Since all your net code fetches string but I dont know how to call the API objects inside processing. Like toddmotto.com/using-html5-geolocation-to-show-current-location-with-google-maps-api/

    navigator.geolocation;
    
    navigator.geolocation.getCurrentPosition();
    
    if(!!navigator.geolocation) {
        // Support
    } else {
        // No support
    }
    

    How to call them inside the processing? Is there any way to this?

  • Search JSON in the Reference page... :-)

  • edited February 2015

    @PhiLho I have done the research for JSON processing. Can you please elaborate how to use JSON for these things? It would be really great if you explain me how to use web API with JSON library. I know it is called JavaScript Object Notation and API are basically JavaScript function written for special purpose but I don't have any idea how to use it.

    1. How to authenticate the user name password? ex: OAuth ?
    2. How to call web API function/Objects inside processing using JSON? such as shown below the navigator JS object

      navigator.geolocation;
      
      navigator.geolocation.getCurrentPosition();
      
      if(!!navigator.geolocation) {
          // Support
      } else {
          // No support
      }
      
    1. is quite a different question. You will need to communicate with the OAuth server, providing proper credential, etc.
    2. You cannot access Json attributes dynamically, like navigator.geolocation. You have to fetch a navigator JSONObject, then query it for a "geolocation" attribute to get its value.
  • can you please show a piece of code?

Sign In or Register to comment.