Search Results

Search found 16923 results on 677 pages for 'facebook graph api'.

Page 9/677 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How can I prompt user for additional permissions on page load?

    - by Rew
    Note: The application I'm building is a website type Facebook Application that uses Facebook Connect. I can prompt the user with a request for Extended Permissions using the following FBML code: <fb:prompt-permission perms="read_stream,publish_stream"> Grant permission for status updates </fb:prompt-permission> Taken from here. This creates a link on the page that must be clicked by the user in order to trigger the prompt to display. My question is: Is it possible to display this prompt automatically, when the page loads, without requiring the user to click on the link? Also, in reply to the answer below, I'd like to avoid displaying the link. Would prefer a neat way to do this, if that fails the least dirty method will do :-)

    Read the article

  • Facebook Connect - Using both FBML and PHP Client

    - by Ryan
    I am doing my second Facebook connect site. On my first site, I used the facebook coonect FBML to sign a user in, then I could access other information via the PHP Client. With this site, using the same exact code, it doesn't seem to be working. I'd like someone to be able to sign in using the Facebook button: <fb:login-button length="long" size="medium" onlogin="facebook_onlogin();"></fb:login-button> After they have logged in, the facebook_onlogin() function makes some AJAX requests to a PHP page which attempts to use the Facebook PHP Client. Here's the code from that page: $facebook = new Facebook('xxxxx API KEY xxxxx', 'xxxxx SECRET KEY xxxxx'); //$facebook->require_login(); ** I DONT WANT THIS LINE!! $userID = $facebook->api_client->users_getLoggedInUser(); if($userID) { $user_details = $facebook->api_client->users_getInfo($userID, 'last_name, first_name'); $firstName = $user_details[0]['first_name']; $lastName = $user_details[0]['last_name']; $this->view->userID = $userID; $this->view->firstName = $firstName; $this->view->lastName = $lastName; } The problem is that the PHP Client thinks I don't have a session key, so the $userID never get set. If I override the $userID with my facebook ID (which I am logged in with) I get this error: exception 'FacebookRestClientException' with message 'A session key is required for calling this method' in C:\wamp\www\mab\application\Facebook\facebookapi_php5_restlib.php:3003 If I uncomment the require_login(), it will get a session ID, but it redirects pages around a lot and breaks my AJAX calls. I am using the same code I successfully did this with on another site. Anyone have any ideas why the PHP client don't know about the session ID after a user has logged in with the connect button? Any ideas would be greatly appreciated. Thanks!

    Read the article

  • How will Facebook Authenticate let me ID a user?

    - by Donny P
    I have a website where I need to have data that is ID'd by user. For example, they enter their favorite food: userid favorite food ------ ------------- 1 french fries 2 tacos 3 fish sticks 4 chipotle When I use Facebook Authentication, what identifier will I use for the userid? I'm assuming it's not name, since this would create duplicates. Is it just the person's Facebook ID? Also is the correct API to use for 3rd party websites 'Facebook Connect' or 'Facebook Authorization' or something else?

    Read the article

  • How can I tag a user in a photo using the Facebook Graph API?

    - by fr6
    I tried: $args = array( 'access_token' => $access_token, 'id' => $uid ); $url = "https://graph.facebook.com/{$idPhoto}/tags"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $data = curl_exec($ch); It has returned me: {"error":{"type":"QueryParseException","message":"Unknown path components: \/tags"}} It does not seem possible because its not in the Facebook documentation: http://developers.facebook.com/docs/api#publishing Can someone confirm me that it's not possible to tag a user in a recently uploaded photo?

    Read the article

  • Facebook Connect: hasPermission() from js?

    - by Martin
    Is it possible to determine whether a user has granted my app a specific permission or not via javascript? Something similar to how you do it in php: $fb->api_client->users_hasAppPermission('publish_stream'); I know i can request a permission with FB.Connect.showPermissionDialog('publish_stream', null); But i just wan't to know if i have the permission or not.

    Read the article

  • Facebook Sidebar/Tab Applications

    - by James
    Been searching the FB documentation to find an answer for this, but have been unsuccessful. Is an application able to appear as a tab on a page/profile, and also in the sidebar of that same page/profile? So the tab would show the full application details, but the sidebar would give a small breakdown. Is this possible? Thanks!

    Read the article

  • Facebook app without asking permissions

    - by jpoz
    Hello, This seems like a pretty simple question but haven't found an answer anywhere: How do I make an app that doesn't ask for permission when you load it? Or is that impossible. The only thing the application is going to do is post to the users wall, but can't I authenticate them for that after they load the application? Thanks in advance for the help, JPoz

    Read the article

  • Passing Global Variable value to Facebook - Gets NULL only

    - by Viral
    hi all friends, I am making a game application in that I want to pass my score on wall of face book. I've completed all the things (the log in and message passing part) but when I passes the score via global variable, I am getting only null as a value and not the score that I want. Is there any way to pass data or string to Face book and write on a wall? My code is (void)viewDidLoad { static NSString* kApiKey = @"be60415be308e2b44c0ac1db83fe486b"; static NSString* kApiSecret = @"4f880c7e100321f808c41b1d3c813dfa"; _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain]; score = [NSString stringWithFormat:@"%@",appDelegate.myTextView]; [_session resume]; [super viewDidLoad]; } whre score is NSString and myTextView is NSString in other viewcontrollerfile, And appDelegate is global variable. Any help?? thanks in advance.

    Read the article

  • Step Aside Google

    - by David Dorf
    Step aside Google. While search will always be a huge part of the web, I can see a day in the not-too-distance future where search takes a backseat to the social graph. Links between pages will give way to relationships between people, including context like location. What does this mean for retail? It means your e-commerce strategy will slowly transition to an f-commerce strategy. Remember when a large portion of the online population was held captive inside the walls of AOL? All the commercials listed an AOL keyword, not a web address because that's where the majority of people surfed. Now, people are spending a huge amount of time in Facebook (despite Betty White's proclamation that its a big waste of time). According to Facebook, users spend 500 billion minutes per month on the site. Selling products where consumers are spending their time makes sense. The power of Like and Share are the most effective approach to marketing. More and more stores are popping up on Facebook, and soon they will be the front-end to e-commerce systems. As sites adopt the Facebook Open Graph API, users will have a harder time distinguishing the open web from their Facebook experience, including shopping. Of course e-commerce sites won't go away, but a large portion of their traffic will emanate from Facebook and in some cases Facebook will act as the front-end for the web store. Ignore Facebook Open Graph at your peril. In a Mashable article, Mitchell Harper made several predictions about how e-commerce will change based on Facebook. His five points are not far-fetched at all, so we need to watch this space carefully.

    Read the article

  • I want to use facebook connect in my website to register, login and comment on news articles or posts made by other users

    - by sasi kiran
    I would like to implement the following things in my website. I have done some extensive search over the internet but couldnt find and specific examples on how to implement them I am developing this site in php using a mvc framework Would like to have facebook registration on my website - users who have an account in facebook will get an option to use the details to register in my site, using their authentication I would pull the relavant details from their account and create a new account for them in my website. I would like to use facebook register fbml/fbjs in this case Would like to have facebook login used to login into my site. How to use the sessions is what I would like to know? I would like to make posts to the facebook-wall of the users registered in my site. Also if possible sent messages to them through my code whenever a new post is made to my site. Thanks for your help.

    Read the article

  • ASP.Net Web API in Visual Studio 2010

    - by sreejukg
    Recently for one of my project, it was necessary to create couple of services. In the past I was using WCF, since my Services are going to be utilized through HTTP, I was thinking of ASP.Net web API. So I decided to create a Web API project. Now the real issue is that ASP.Net Web API launched after Visual Studio 2010 and I had to use ASP.Net web API in VS 2010 itself. By default there is no template available for Web API in Visual Studio 2010. Microsoft has made available an update that installs ASP.Net MVC 4 with web API in Visual Studio 2010. You can find the update from the below url. http://www.microsoft.com/en-us/download/details.aspx?id=30683 Though the update denotes ASP.Net MVC 4, this also includes ASP.Net Web API. Download the installation media and start the installer. As usual for any update, you need to agree on terms and conditions. The installation starts straight away, once you clicked the Install button. If everything goes ok, you will see the success message. Now open Visual Studio 2010, you can see ASP.Net MVC 4 Project template is available for you. Now you can create ASP.Net Web API project using Visual Studio 2010. When you create a new ASP.Net MVC 4 project, you can choose the Web API template. Further reading http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api http://www.asp.net/mvc/mvc4

    Read the article

  • Location tagging facebook open graph actions so that only friends in that location view in their feeds

    - by Arvind Srinivasan
    Is there a way to tag open graph actions so as to target certain recipients and not others? For example, if my app talks about new coffee shop openings in various cities, is there a way to publish the 'opening' action to the graph, perhaps with location / coordinates, such that this is only seen by friends in that locality? I really don't want to spam my friends in London about an opening I'm excited about in Portland. How can I help facebook with the feed relevance in these cases? I noticed that there is a "place" property on open graph objects - could this somehow be used?

    Read the article

  • How do I get public feed from facebook without user authentication on a native/Desktop app?

    - by KronoS
    I'm looking to get publicly available facebook feeds (i.e. Google's facebook page/posts). However instead of forcing the user to sign into their own facebook app, I want to be able to access these posts. I've looked into using "App Access Tokens" however since my application is a native/Desktop app (iOS, Android, WP8/Win 8) I'm not able to do this. Is there a way to get publicly accessible feeds from facebook without user authentication? I'm using the Facebook C# SDK to access facebook. Currently I'm doing the following: dynamic tokenInfo = fb.Get( String.Format( "/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials", FbController.AppId, FbController.AppSecret)); var appAccessToken = (string) tokenInfo.access_token; fb = new FacebookClient(); dynamic response = fb.Get( String.Format( "/google/posts?access_token={0}", appAccessToken)); Problem is that this only works if my application is set to "web" instead of "native/Desktop". I get the following error when running this code and classified app as native/Desktop. (OAuthException - #15) (#15) Requires session when calling from a desktop app

    Read the article

  • Passing multiple POST parameters to Web API Controller Methods

    - by Rick Strahl
    ASP.NET Web API introduces a new API for creating REST APIs and making AJAX callbacks to the server. This new API provides a host of new great functionality that unifies many of the features of many of the various AJAX/REST APIs that Microsoft created before it - ASP.NET AJAX, WCF REST specifically - and combines them into a whole more consistent API. Web API addresses many of the concerns that developers had with these older APIs, namely that it was very difficult to build consistent REST style resource APIs easily. While Web API provides many new features and makes many scenarios much easier, a lot of the focus has been on making it easier to build REST compliant APIs that are focused on resource based solutions and HTTP verbs. But  RPC style calls that are common with AJAX callbacks in Web applications, have gotten a lot less focus and there are a few scenarios that are not that obvious, especially if you're expecting Web API to provide functionality similar to ASP.NET AJAX style AJAX callbacks. RPC vs. 'Proper' REST RPC style HTTP calls mimic calling a method with parameters and returning a result. Rather than mapping explicit server side resources or 'nouns' RPC calls tend simply map a server side operation, passing in parameters and receiving a typed result where parameters and result values are marshaled over HTTP. Typically RPC calls - like SOAP calls - tend to always be POST operations rather than following HTTP conventions and using the GET/POST/PUT/DELETE etc. verbs to implicitly determine what operation needs to be fired. RPC might not be considered 'cool' anymore, but for typical private AJAX backend operations of a Web site I'd wager that a large percentage of use cases of Web API will fall towards RPC style calls rather than 'proper' REST style APIs. Web applications that have needs for things like live validation against data, filling data based on user inputs, handling small UI updates often don't lend themselves very well to limited HTTP verb usage. It might not be what the cool kids do, but I don't see RPC calls getting replaced by proper REST APIs any time soon.  Proper REST has its place - for 'real' API scenarios that manage and publish/share resources, but for more transactional operations RPC seems a better choice and much easier to implement than trying to shoehorn a boatload of endpoint methods into a few HTTP verbs. In any case Web API does a good job of providing both RPC abstraction as well as the HTTP Verb/REST abstraction. RPC works well out of the box, but there are some differences especially if you're coming from ASP.NET AJAX service or WCF Rest when it comes to multiple parameters. Action Routing for RPC Style Calls If you've looked at Web API demos you've probably seen a bunch of examples of how to create HTTP Verb based routing endpoints. Verb based routing essentially maps a controller and then uses HTTP verbs to map the methods that are called in response to HTTP requests. This works great for resource APIs but doesn't work so well when you have many operational methods in a single controller. HTTP Verb routing is limited to the few HTTP verbs available (plus separate method signatures) and - worse than that - you can't easily extend the controller with custom routes or action routing beyond that. Thankfully Web API also supports Action based routing which allows you create RPC style endpoints fairly easily:RouteTable.Routes.MapHttpRoute( name: "AlbumRpcApiAction", routeTemplate: "albums/{action}/{title}", defaults: new { title = RouteParameter.Optional, controller = "AlbumApi", action = "GetAblums" } ); This uses traditional MVC style {action} method routing which is different from the HTTP verb based routing you might have read a bunch about in conjunction with Web API. Action based routing like above lets you specify an end point method in a Web API controller either via the {action} parameter in the route string or via a default value for custom routes. Using routing you can pass multiple parameters either on the route itself or pass parameters on the query string, via ModelBinding or content value binding. For most common scenarios this actually works very well. As long as you are passing either a single complex type via a POST operation, or multiple simple types via query string or POST buffer, there's no issue. But if you need to pass multiple parameters as was easily done with WCF REST or ASP.NET AJAX things are not so obvious. Web API has no issue allowing for single parameter like this:[HttpPost] public string PostAlbum(Album album) { return String.Format("{0} {1:d}", album.AlbumName, album.Entered); } There are actually two ways to call this endpoint: albums/PostAlbum Using the Model Binder with plain POST values In this mechanism you're sending plain urlencoded POST values to the server which the ModelBinder then maps the parameter. Each property value is matched to each matching POST value. This works similar to the way that MVC's  ModelBinder works. Here's how you can POST using the ModelBinder and jQuery:$.ajax( { url: "albums/PostAlbum", type: "POST", data: { AlbumName: "Dirty Deeds", Entered: "5/1/2012" }, success: function (result) { alert(result); }, error: function (xhr, status, p3, p4) { var err = "Error " + " " + status + " " + p3; if (xhr.responseText && xhr.responseText[0] == "{") err = JSON.parse(xhr.responseText).message; alert(err); } }); Here's what the POST data looks like for this request: The model binder and it's straight form based POST mechanism is great for posting data directly from HTML pages to model objects. It avoids having to do manual conversions for many operations and is a great boon for AJAX callback requests. Using Web API JSON Formatter The other option is to post data using a JSON string. The process for this is similar except that you create a JavaScript object and serialize it to JSON first.album = { AlbumName: "PowerAge", Entered: new Date(1977,0,1) } $.ajax( { url: "albums/PostAlbum", type: "POST", contentType: "application/json", data: JSON.stringify(album), success: function (result) { alert(result); } }); Here the data is sent using a JSON object rather than form data and the data is JSON encoded over the wire. The trace reveals that the data is sent using plain JSON (Source above), which is a little more efficient since there's no UrlEncoding that occurs. BTW, notice that WebAPI automatically deals with the date. I provided the date as a plain string, rather than a JavaScript date value and the Formatter and ModelBinder both automatically map the date propertly to the Entered DateTime property of the Album object. Passing multiple Parameters to a Web API Controller Single parameters work fine in either of these RPC scenarios and that's to be expected. ModelBinding always works against a single object because it maps a model. But what happens when you want to pass multiple parameters? Consider an API Controller method that has a signature like the following:[HttpPost] public string PostAlbum(Album album, string userToken) Here I'm asking to pass two objects to an RPC method. Is that possible? This used to be fairly straight forward either with WCF REST and ASP.NET AJAX ASMX services, but as far as I can tell this is not directly possible using a POST operation with WebAPI. There a few workarounds that you can use to make this work: Use both POST *and* QueryString Parameters in Conjunction If you have both complex and simple parameters, you can pass simple parameters on the query string. The above would actually work with: /album/PostAlbum?userToken=sekkritt but that's not always possible. In this example it might not be a good idea to pass a user token on the query string though. It also won't work if you need to pass multiple complex objects, since query string values do not support complex type mapping. They only work with simple types. Use a single Object that wraps the two Parameters If you go by service based architecture guidelines every service method should always pass and return a single value only. The input should wrap potentially multiple input parameters and the output should convey status as well as provide the result value. You typically have a xxxRequest and a xxxResponse class that wraps the inputs and outputs. Here's what this method might look like:public PostAlbumResponse PostAlbum(PostAlbumRequest request) { var album = request.Album; var userToken = request.UserToken; return new PostAlbumResponse() { IsSuccess = true, Result = String.Format("{0} {1:d} {2}", album.AlbumName, album.Entered,userToken) }; } with these support types:public class PostAlbumRequest { public Album Album { get; set; } public User User { get; set; } public string UserToken { get; set; } } public class PostAlbumResponse { public string Result { get; set; } public bool IsSuccess { get; set; } public string ErrorMessage { get; set; } }   To call this method you now have to assemble these objects on the client and send it up as JSON:var album = { AlbumName: "PowerAge", Entered: "1/1/1977" } var user = { Name: "Rick" } var userToken = "sekkritt"; $.ajax( { url: "samples/PostAlbum", type: "POST", contentType: "application/json", data: JSON.stringify({ Album: album, User: user, UserToken: userToken }), success: function (result) { alert(result.Result); } }); I assemble the individual types first and then combine them in the data: property of the $.ajax() call into the actual object passed to the server, that mimics the structure of PostAlbumRequest server class that has Album, User and UserToken properties. This works well enough but it gets tedious if you have to create Request and Response types for each method signature. If you have common parameters that are always passed (like you always pass an album or usertoken) you might be able to abstract this to use a single object that gets reused for all methods, but this gets confusing too: Overload a single 'parameter' too much and it becomes a nightmare to decipher what your method actual can use. Use JObject to parse multiple Property Values out of an Object If you recall, ASP.NET AJAX and WCF REST used a 'wrapper' object to make default AJAX calls. Rather than directly calling a service you always passed an object which contained properties for each parameter: { parm1: Value, parm2: Value2 } WCF REST/ASP.NET AJAX would then parse this top level property values and map them to the parameters of the endpoint method. This automatic type wrapping functionality is no longer available directly in Web API, but since Web API now uses JSON.NET for it's JSON serializer you can actually simulate that behavior with a little extra code. You can use the JObject class to receive a dynamic JSON result and then using the dynamic cast of JObject to walk through the child objects and even parse them into strongly typed objects. Here's how to do this on the API Controller end:[HttpPost] public string PostAlbum(JObject jsonData) { dynamic json = jsonData; JObject jalbum = json.Album; JObject juser = json.User; string token = json.UserToken; var album = jalbum.ToObject<Album>(); var user = juser.ToObject<User>(); return String.Format("{0} {1} {2}", album.AlbumName, user.Name, token); } This is clearly not as nice as having the parameters passed directly, but it works to allow you to pass multiple parameters and access them using Web API. JObject is JSON.NET's generic object container which sports a nice dynamic interface that allows you to walk through the object's properties using standard 'dot' object syntax. All you have to do is cast the object to dynamic to get access to the property interface of the JSON type. Additionally JObject also allows you to parse JObject instances into strongly typed objects, which enables us here to retrieve the two objects passed as parameters from this jquery code:var album = { AlbumName: "PowerAge", Entered: "1/1/1977" } var user = { Name: "Rick" } var userToken = "sekkritt"; $.ajax( { url: "samples/PostAlbum", type: "POST", contentType: "application/json", data: JSON.stringify({ Album: album, User: user, UserToken: userToken }), success: function (result) { alert(result); } }); Summary ASP.NET Web API brings many new features and many advantages over the older Microsoft AJAX and REST APIs, but realize that some things like passing multiple strongly typed object parameters will work a bit differently. It's not insurmountable, but just knowing what options are available to simulate this behavior is good to know. Now let me say here that it's probably not a good practice to pass a bunch of parameters to an API call. Ideally APIs should be closely factored to accept single parameters or a single content parameter at least along with some identifier parameters that can be passed on the querystring. But saying that doesn't mean that occasionally you don't run into a situation where you have the need to pass several objects to the server and all three of the options I mentioned might have merit in different situations. For now I'm sure the question of how to pass multiple parameters will come up quite a bit from people migrating WCF REST or ASP.NET AJAX code to Web API. At least there are options available to make it work.© Rick Strahl, West Wind Technologies, 2005-2012Posted in Web Api   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • What are all the components of a "Facebook App"?

    - by pnongrata
    I am a developer who has never personally partaken in social media (in any form) for reasons completely outside the scope of this question. I am "off the grid" (no Facebook, Twitter, etc accounts). I'm currently building a web app and would like the app to have a presence on Facebook, and possibly even "port" my app over as a Facebook app. My understanding of Facebook Apps is that they're just normal web apps that get <iframe>d into a Facebook page. The app is actually hosted on your server (not FB's servers). But this got me thinking: Don't Facebook Apps have "profile pages"? Is there anything developers can do to customize the behavior of their own profile pages? Do apps have the ability to do things like MySpace themes used to do (i.e., customize and interact with User profile pages, Groups, etc.)? Do Facebook Apps gain any sort of extra capabilities (inside of Facebook) that a normal web app would not have? It seems to me like if all a Facebook App is, is an iframed-web app, that it would still need to communicate with Facebook via its many APIs, just like a normal app would have to, right? If it's not possible to write an app that can customize the UI or behavior of user profiles and other pages, then how do games like "Farmville" interact with User profiles so that you see updates to profiles like "John Smith reached level 2 of Farmville"? Basically, I'm asking any battle-worn Facebook app developers if my understanding of Facebook Apps is correct, or if I'm missing anything big here. It's my understanding that for security reasons (obviously) Facebook doesn't allow apps to customize anything outside of the iframe it lives in. So if I want my app to appear like it's "interacting" with its Facebook users, it looks like I just need to publish stuff to the users' news feeds to try and encourage people to use my app (please correct me if I'm wrong here!). Thanks in advance for any corrections, clarifications, advice or suggestions!

    Read the article

  • how to get all group images in facebook using FACEBOOK API

    - by From.ME.to.YOU
    Hello i'm trying to get all the images from a facebook group using facebook API i have a problem i can't get all the photos using $facebook->api_client->call_method('Photos.get', array('subj_id' => $uid)); http://wiki.developers.facebook.com/index.php/Photos.get what i'm using now is the method $albums = $facebook->api_client->photos_getAlbums($uid, NULL); http://wiki.developers.facebook.com/index.php/Photos.getAlbums and then loop for ever album on $facebook->api_client->call_method('Photos.get', array('subj_id' => $uid)); then i add every new array results to my big array $big_array = array_merge($big_array,$result_array_from_that_call); 2 problems occurs here : 1- sometimes this calls fails - i think because of too many calls per second - 2- the request takes a v.long time to process is there a better way to do that? Thanks guys Cheers EDIT :: i tried to get all the images using $facebook->api_client->call_method('Photos.get', array('subj_id' => $uid)); and using $uid as the group ID but that's doesn't work " don't know why maybe because all the images is listed in groups "

    Read the article

  • Facebook and Twitter Shoes [Geek Fun]

    - by Gopinath
    For all the Facebook and Twitter enthusiasts, here are cool designs of Facebook and Twitter Shoes.   There are not real shoes and you can’t buy them anywhere. They are just dream visuals created by Mckay and he says in a blog post Facebook as a brand is increasingly on the rise and I thought it would be interesting to see what it would look like if Adidas also released a limited edition Facebook Superstar, so I worked on my own design of the shoe and this is what I came up with Would not it be cool if the social giants bring these shoe designs to reality? This article titled,Facebook and Twitter Shoes [Geek Fun], was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Should one always know what an API is doing just by looking at the code?

    - by markmnl
    Recently I have been developing my own API and with that invested interest in API design I have been keenly interested how I can improve my API design. One aspect that has come up a couple times is (not by users of my API but in my observing discussion about the topic): one should know just by looking at the code calling the API what it is doing. For example see this discussion on GitHub for the discourse repo, it goes something like: foo.update_pinned(true, true); Just by looking at the code (without knowing the parameter names, documentation etc.) one cannot guess what it is going to do - what does the 2nd argument mean? The suggested improvement is to have something like: foo.pin() foo.unpin() foo.pin_globally() And that clears things up (the 2nd arg was whether to pin foo globally, I am guessing), and I agree in this case the later would certainly be an improvement. However I believe there can be instances where methods to set different but logically related state would be better exposed as one method call rather than separate ones, even though you would not know what it is doing just by looking at the code. (So you would have to resort to looking at the parameter names and documentation to find out - which personally I would always do no matter what if I am unfamiliar with an API). For example I expose one method SetVisibility(bool, string, bool) on a FalconPeer and I acknowledge just looking at the line: falconPeer.SetVisibility(true, "aerw3", true); You would have no idea what it is doing. It is setting 3 different values that control the "visibility" of the falconPeer in the logical sense: accept join requests, only with password and reply to discovery requests. Splitting this out into 3 method calls could lead to a user of the API to set one aspect of "visibility" forgetting to set others that I force them to think about by only exposing the one method to set all aspects of "visibility". Furthermore when the user wants to change one aspect they almost always will want to change another aspect and can now do so in one call.

    Read the article

  • What is the evidence that an API has exceeded its orthogonality in the context of types?

    - by hawkeye
    Wikipedia defines software orthogonality as: orthogonality in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the language. The term is most-frequently used regarding assembly instruction sets, as orthogonal instruction set. Jason Coffin has defined software orthogonality as Highly cohesive components that are loosely coupled to each other produce an orthogonal system. C.Ross has defined software orthogonality as: the property that means "Changing A does not change B". An example of an orthogonal system would be a radio, where changing the station does not change the volume and vice-versa. Now there is a hypothesis published in the the ACM Queue by Tim Bray - that some have called the Bánffy Bray Type System Criteria - which he summarises as: Static typings attractiveness is a direct function (and dynamic typings an inverse function) of API surface size. Dynamic typings attractiveness is a direct function (and static typings an inverse function) of unit testing workability. Now Stuart Halloway has reformulated Banfy Bray as: the more your APIs exceed orthogonality, the better you will like static typing My question is: What is the evidence that an API has exceeded its orthogonality in the context of types? Clarification Tim Bray introduces the idea of orthogonality and APIs. Where you have one API and it is mainly dealing with Strings (ie a web server serving requests and responses), then a uni-typed language (python, ruby) is 'aligned' to that API - because the the type system of these languages isn't sophisticated, but it doesn't matter since you're dealing with Strings anyway. He then moves on to Android programming, which has a whole bunch of sensor APIs, which are all 'different' to the web server API that he was working on previously. Because you're not just dealing with Strings, but with different types, the API is non-orthogonal. Tim's point is that there is a empirical relationship between your 'liking' of types and the API you're programming against. (ie a subjective point is actually objective depending on your context).

    Read the article

  • Using Facebook Connect auth.RevokeAuthorization in ASP.NET

    - by Focus
    I'm confused as to how revoking authorization works in the ASP.NET Toolkit. I've tried issuing the following: ConnectSession connect = new ConnectSession(FacebookHelper.ApiKey(), FacebookHelper.SecretKey()); Auth x = new Auth(fbSession); x.RevokeAuthorization(); But I get an object reference error during the RevokeAuthorization call. Here's the call definition. Any idea what I'm doing wrong?

    Read the article

  • Facebook - Publish Checkins using Graph API

    - by Zany
    I'm trying to publish Checkin using Facebook Graph API. I've gone through Facebook API documentation (checkins) and also have the publish_checkins permission. However, my checkin is not getting published. May I know is there anything wrong or am I missing anything else? Thank you for your time :) fbmain.php $user = $facebook->getUser(); $access_token = $facebook->getAccessToken(); // Session based API call if ($user) { try { $me = $facebook->api('/me'); if($me) { $_SESSION['fbID'] = $me['id']; $uid = $me['id']; } } catch (FacebookApiException $e) { error_log($e); } } else { echo "<script type='text/javascript'>top.location.href='$loginUrl';</script>"; exit; } $loginUrl = $facebook->getLoginUrl( array( 'redirect_uri' => $redirect_url, 'scope' => status_update, publish_stream, publish_checkins, user_checkins, user_location, user_status' ) ); main.php (Updated: 18/6/2012 11.12pm) <?php include_once "fbmain.php"; if (!isset($_POST['latitude']) && !isset($_POST['longitude'])) { ?> <html> <head> //ajax POST of latitude and longitude </head> <body> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: '<?php echo $facebook->getAppID() ?>', cookie: true, xfbml: true, oauth: true, frictionlessRequests: true }); FB.Canvas.setAutoGrow(); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script> ... <input type="button" value="Check In!" onclick="checkin(<?=$facebook?>);"/></span> </body> </html> <?php } else { print_r($_POST['latitude']); print_r($_POST['longitude']); ?> <script type="text/javascript"> // not using latitude and longitude to test function checkin($fb) { try { $tryCatch = $facebook->api('/'.$_SESSION['fbID'].'/checkins', 'POST', array( 'access_token' => $fb->getAccessToken(), //corrected 'place' => '165122993538708', 'message' =>'I went to placename today', 'coordinates' => json_encode(array( 'latitude' => '1.3019399200902', 'longitude' => '103.84067653695' )) )); } catch(FacebookApiException $e) { $tryCatch=$e->getMessage(); } return $tryCatch; } </script> <?php } ?>

    Read the article

  • Facebook Invalid OAuth access token signature trying to post an attachment to group wall from PHP

    - by Volodymyr B
    I am an administrator (manager role) of a Facebook Group. I created an app, and stored its id and secret. I want my app to be able to post something on the Facebook group's feed. But when I attempt to post, I get the error 190 Invalid OAuth access token signature, even though I able to successfully obtain the access_token with publish_stream and offline_access scopes. It has the form of NNNNNNNNNNNNNNN|XXXXXXXXXXXXXXXXXXXXXXXXXXX, where N is a number (15) and X is a letter or a number (27). What should I do more to get this accomplished? Here is the code I am using: public static function postToFB($message, $image, $link) { //Get App Token $token = self::getFacebookToken(); // Create FB Object Instance $facebook = new Facebook(array( 'appId' => self::fb_appid, 'secret' => self::fb_secret, 'cookie' => true )); //$token = $facebook->getAccessToken(); //Try to Publish on wall or catch the Facebook exception try { $attachment = array('access_token' => $token, 'message' => $message, 'picture' => $image, 'link' => $link, //'name' => '', //'caption' => '', 'description' => 'More...', //'actions' => array(array('name' => 'Action Text', 'link' => 'http://apps.facebook.com/xxxxxx/')) ); $result = $facebook->api('/'.self::fb_groupid.'/feed/', 'post', $attachment); } catch (FacebookApiException $e) { //If the post is not published, print error details echo '<pre>'; print_r($e); echo '</pre>'; } } Code which returns the token //Function to Get Access Token public static function getFacebookToken($appid = self::fb_appid, $appsecret = self::fb_secret) { $args = array( 'grant_type' => 'client_credentials', 'client_id' => $appid, 'client_secret' => $appsecret, 'redirect_uri' => 'https://www.facebook.com/connect/login_success.html', 'scope' => 'publish_stream,offline_access' ); $ch = curl_init(); $url = 'https://graph.facebook.com/oauth/access_token'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); try { $data = curl_exec($ch); } catch (Exception $exc) { error_log($exc->getMessage()); } return json_encode($data); } If I uncomment $token = $facebook->getAccessToken(); in the posting code, it gives me yet another error (#200) The user hasn't authorized the application to perform this action. The token I get using developers.facebook.com/tools/explorer/ is of another form, much longer and with it I am able to post to the group page feed. How do I do it without copy/paste from Graph API Explorer and how do I post as a group instead of posting as a user? Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >