How to know if someone is fan of my facebook page? - php

I know this subject has been done already over and over. but... i must be stupid so i'll try to figure out my problem simply.
I have a facebook page, let s say that one :
http://www.facebook.com/pages/Medieval-Forgecom/302734029745018
with a few fan poeple.
now on my website i would like to give a discount to poeple who are fan of that page.
So i tried the php api (with an application id and secret) before discovering that this is NOT what i want as my page is not an app and has no appId neither secret. Am i misunderstanding something here?
So i m wondering how in php i can know if someone is fan or not...
If it is not possible i could use the javascript api to make this check ( wich is quite bad, it should be done somewhere via php) but even this way i get trouble with the deprecated api and the code refering to javascript inside the facebook website.
in a nutshell, i'm lost.
thanks for your time and attention.

Do some research on the concept of "fan-gate". I think this is what you're looking for.
https://www.facebook.com/note.php?note_id=10150130919053430
http://www.youtube.com/watch?v=fBBnrtG0hAw

There are three ways of using Facebook API. Social plugins are widgets such as comments or like buttons. You can put them into your site directly and easily. And then there is the Graph API. First way of using this API is to create a whole standalone Facebook application, such as Farmwille. Second way is to use it only at your site, out of the Facebook frame. Regardless of the type of your usage, you need to register an application on Facebook, so Facebook API can authorize you. Without that you can't use the API. You don't need to create a real standalone app if you want only to use the API at your own site, but you must register it and this registration is just called Facebook application. It can be virtual application representing your site.

Related

How to create a facebook app without much knowledge of PHP/MYSQL?

I'm trying to SUGGEST, or CREATE an app, and I don't have any knowledge of facebook app creation... I've looked up on tutorials, but facebook's API might change or has changed by the date of those tutorials...
So I thought I'll ask on here, after searching for a facebook developer's support, I was redirected to here.
My question: What is the best way to create a basic app, as per my requirements (below)..?
My Suggestion/Requirements: I wrote this tutorial on superuser, which lets you display your current playing track as an updated div on your html based website. I'm trying to create a facebook app that posts these track info updates to the right side of the facebook home panel (above the chat column). Like Spotify! Or SoundCloud...
My Problem: I don't know where to start? I don't have much knowledge of scripting and according to me, it should be quite simple in PHP/MYSQL/Javascript/ ... but don't know how facebook would handle the html file from where the <div> data could be collected. I think jquery would solve that, but this can also be done via PHP/MYSQL.
It should be simple, so I'm also suggesting this as an idea for anyone willing to create this app on facebook? And if you create it, please do keep it open source project or a tutorial for it, so that if at any time you close the app, it can still be replicated. I cannot create it but am willing to, but don't know how to...
I'm asking this here because facebook doesn't appear to have a forum based posts for this apart from the developers group. I've joined the facebook developers group, but haven't yet been allowed to post anything, as the join request is pending.
That's mostly all. Thanks for any help.
Start with registering your application on Facebook .It will give you some token and keys.
Now you can follow any tutorial online to create application on fb.

Add users post to their facebook newsfeed automtically with php

I have a website I'm working on. It enables users to register and post stuffs within the site. Can I get a link to some sort of api that allows people to add their facebook account (once) and then automatically post what they posted on my site on their facebook newsfeed (the sort of thing that happens when you connect your facebook account to your twitter account) .I've searched and can't seem to get exactly what I want
What you want is pretty common and if you searched you clearly didn't do a good job on the search.
Using the Facebook PHP SDK is pretty straight forward. There is a PHP Library available with a demo of the functionality you want. In your case you need to do some stuff more, so I'll explain globally what you should do:
Get the Facebook PHP SDK and load it into your website, determine what scope you need to perform the actions what you are going to do, in your case you need to have access to their timeline which is called the publish_stream scope. In order to get the Facebook PHP SDK working you need to create an app at http://developers.facebook.com
If a user grants access you need to save the authentication token that the user provides and save it in your database for later use. I'm not 100% sure how long they are valid, I think it's maximum of 30 days at the moment, but you have the ability to refresh the toking in the requests you make (correct me if I'm wrong, it's been a while..)
Everytime an action is done using the Facebook API you inject the usertoken in the request, thus performing the "post" action onto their timeline.
What you are looking for is pretty straight forward and easy to find..

Upload Post to Facebook Automatically in PHP

I've made my own "blog-style" site, without using WordPress or anything of the sort. I'm looking for a way to automatically post a certain portion of the article to the Facebook Wall of the Facebook Page I run for the website. Is there an easy way to do this? I'm using PHP for post submission.
This is possible using the Facebook API. You can probably find PHP libraries that cover much of the functionality but it would still be a good idea to get your head around the Facebook API so that you understand how things work. See http://developers.facebook.com/docs/reference/api/

Posting to User's walls as application using Facebook PHP API

I've been building a web app that uses facebook integration for easier registration/login and notifications for the users. However, for the notifications I want to be able to post to a users facebook wall when something happens on our site.
Really I see two possible problems with doing this. First being that the user will most likely not be logged in to our website when the notification needs to happen. Second I have not found a way to post to the feed using any identity other than the current logged in user.
So to reiterate exactly what I'm trying to do. When some action takes place on my site involving Bob, I want the websites application to post on Bobs wall notifying him of the action as if the application is one of Bobs friends. From some of the things I've seen while researching this, it seems as if facebook might not treat applications like users and I might have to go through a page to accomplish what I want. But really I'm ok with that.
What you need to do is to ask for the offline_access permission. Then you can store their graph id property after they login/authorize to your site's database. Then you just post to that graph id instead of instead of /me. In your case you would then POST a request to the "$user_graph_id/feed" endpoint with whatever parameters you usually have.

Can you use the Facebook API to update a Page (rather than a Profile)?

As far as I can tell you can't add the Developer package to a Pages account - as in I haven't got a Facebook profile.
It's for business purposes and I'd really like to know if you can use the Facebook API to update a Pages status.
Thanks :)
Yes its possible although not officially documented.
Pageids behave in many function calls very similar to profileids.
You dont need to add the developer app to a page - remember: you neither need your users to add it.
I am pretty sure that the Stream API wont work. But you can do the approach described at http://www.allfacebook.com/2009/04/public-profile-twitter/
If you are not into Development and simply want to update your page you can use your twitter account and add a hashtag to sync it to your facebook page with Selective Twitter.
http://www.facebook.com/apps/application.php?id=115463795461
Update: as pointed out below http://ping.fm is also a good service offering this feature

Categories