From 9cca799e77aaf60561c303dbb0dac3ce9d78a3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 22 Apr 2016 14:00:39 +0200 Subject: Remove fireeagle example Quote from wikipedia: "Fire Eagle has closed as of February 2013". --- examples/Makefile.am | 3 +- examples/get-fireeagle-location.c | 91 --------------------------------------- 2 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 examples/get-fireeagle-location.c (limited to 'examples') diff --git a/examples/Makefile.am b/examples/Makefile.am index 90aa89e..4f68e7c 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,11 +1,10 @@ -noinst_PROGRAMS = test-raw test-xml dump-xml get-fireeagle-location post-twitter post-twitter-media get-flickr-favorites lastfm-shout continuous-twitter +noinst_PROGRAMS = test-raw test-xml dump-xml post-twitter post-twitter-media get-flickr-favorites lastfm-shout continuous-twitter AM_CFLAGS = $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) $(SOUP_CFLAGS) -I$(top_srcdir) AM_LDFLAGS = $(GLIB_LIBS) $(GTHREAD_LIBS) $(SOUP_LIBS) ../rest/librest-@API_VERSION@.la ../rest-extras/librest-extras-@API_VERSION@.la test_raw_SOURCES = test-raw.c test_xml_SOURCES = test-xml.c -get_fireeagle_location_SOURCES = get-fireeagle-location.c dump_xml_SOURCES = dump-xml.c post_twitter_SOURCES = post-twitter.c post_twitter_media_SOURCES = post-twitter-media.c diff --git a/examples/get-fireeagle-location.c b/examples/get-fireeagle-location.c deleted file mode 100644 index 101aa75..0000000 --- a/examples/get-fireeagle-location.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * librest - RESTful web services access - * Copyright (c) 2008, 2009, Intel Corporation. - * - * Authors: Rob Bradford - * Ross Burton - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU Lesser General Public License, - * version 2.1, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include -#include -#include - -int -main (int argc, char **argv) -{ - RestProxy *proxy; - RestProxyCall *call; - GError *error = NULL; - char pin[256]; - RestXmlParser *parser; - RestXmlNode *root, *node; - -#if !GLIB_CHECK_VERSION (2, 36, 0) - g_type_init (); -#endif - - /* Create the proxy */ - proxy = oauth_proxy_new (/* Consumer Key */ - "NmUm6hxQ9a4u", - /* Consumer Secret */ - "t4FM7LiUeD4RBwKSPa6ichKPDh5Jx4kt", - /* FireEagle endpoint */ - "https://fireeagle.yahooapis.com/", FALSE); - - /* First stage authentication, this gets a request token. */ - if (!oauth_proxy_request_token (OAUTH_PROXY (proxy), - "oauth/request_token", - "oob", - &error)) - g_error ("Cannot request token: %s", error->message); - - /* From the token construct a URL for the user to visit */ - g_print ("Go to https://fireeagle.yahoo.net/oauth/authorize?oauth_token=%s then enter the verification code\n", - oauth_proxy_get_token (OAUTH_PROXY (proxy))); - - /* Read the PIN */ - fgets (pin, sizeof (pin), stdin); - g_strchomp (pin); - - /* Second stage authentication, this gets an access token. */ - if (!oauth_proxy_access_token (OAUTH_PROXY (proxy), - "oauth/access_token", - pin, - &error)) - g_error ("Cannot request token: %s", error->message); - - /* Get the user's current location */ - call = rest_proxy_new_call (proxy); - rest_proxy_call_set_function (call, "api/0.1/user"); - - if (!rest_proxy_call_run (call, NULL, &error)) - g_error ("Cannot make call: %s", error->message); - - parser = rest_xml_parser_new (); - root = rest_xml_parser_parse_from_data (parser, - rest_proxy_call_get_payload (call), - rest_proxy_call_get_payload_length (call)); - g_object_unref (parser); - g_object_unref (call); - g_object_unref (proxy); - - node = rest_xml_node_find (root, "location"); - node = rest_xml_node_find (node, "name"); - g_print ("%s\n", node->content); - - return 0; -} -- cgit v1.2.1