I'm using the Facebook API Graph (C# & ASP.NET) to try to dynamically post to a Facebook page I created.
Looking at the code samples floating around.. they suggest creating a Facebook App first (which I have done)..
However..
I have 3 different pages I want to post to.. Do I need to create an app for each? (I want to post different things to the 3 pages, not the same posts to each)
I just want messages & links to appear as Wall posts. I'm not bothered about having an 'app' that has 'canvas' that is placed in an IFrame.
Question : So do I still need to write one or more Facebook Apps to post to my 3 different Facebook pages??
Where I am so far.. I can pass in my apps credentials and get back the access_token. But my posts don't appear to be going anywhere.
I'd rather drop the 'facebook application /canvas' approach if possible If I can post directly to a wall (For the above reasons).
Oh, and before you ask. I don't want to post to my Apps Wall page, I want to post to my other pages (Unless I have to post to my Apps Wall page first?).
I'm sure loads of people have the same questions..
Thanks in advance.
-- Lee
You can do this with only one app
You'll need these permissions offline_access, publish_stream,
manage_page
After "me" request in response you should parse active_tokens of pages
you administer
Before you make publish request make sure you set
"_facebook.active_token" to
active_token of page where you want
to publish
I think you need to create the Facebook App, because that's the only way you'll get the set of API keys you need for using the API. I think that's the only reason. It's the same when you're using Facebook only for authentication.
1 - I have 3 different pages I want to post to.. Do I need to create an app for each?
No because there is an option to allow an single app to handle multiple pages.
2 - I just want messages & links to appear as Wall posts. I'm not bothered about having an 'app' that has 'canvas' that is placed in an IFrame.
You can do that surely with the help of their Graph API.
You don't necessarily need a canvas, though keep in mind that's where users will go when they click on the name of your app.
Take a look at the Graph API: http://developers.facebook.com/docs/api, particularly the Publishing section. You want to use /PROFILE_ID/feed, where PROFILE_ID is the id of the page you want to post to.
Related
Is there a way to publish a single post with multiple photos? e.g. - sample facebook post
You can do this on the Facebook Page when composing a post (composing a post with many photos).
I came across this post but I don't want to create a story.
I want to create a POST on the PAGE with a collection of photos that I can track likes and comments on like the example stated earlier.
I am using the Facebook SDK.Net that has a batch upload feature - but that creates a post per photo.
Is there a way it be done? Or are there any suggestions?
I do not believe that it is possible to do a Post with multiple photos using the Graph API. Creating a Facebook Post means sending a POST to the endpoint https://graph.facebook.com/me/feed. In that endpoint, you can include a "picture" property in the query string. This is the URL of the picture you want to include in the Facebook post. In your created post Facebook does not reference your picture from that URL, it makes a copy.
Example POST request:
https://graph.facebook.com/me/feed?message=check%20out%20this%20picture&picture=http%3A%2F%2Fwww.mydomain.com%2Fmyphoto.png
On the desktop and mobile apps, you can add as many photos as you like but they are still uploaded individually. Using the console you can see that they are uploaded using the endpoint https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished It is only after you press the "Post" button are they then associated with your status message.
First of all, sorry for my newbie question...
I am google-ing for something like that for days, but still no luck.
I can't find any examples for using the Facebook C# SDK
with Facebook Page Tab applications.
Unfortunately most examples are for Facebook Canvas applications
and I can't make them work with a Page Tab application.
I really need to see a working example of the following:
Get whether the User Liked my page, or not.
If the User Liked my page, show an "authorize" link/button.
On clicking the "authorize" link/button, ask for User's permission to:
access his info, post to his wall, etc.
(using facebook's usual dialogs for that)
After the User accepts, redirect him to the "member's only" page.
(...inside the tab application frame. not a canvas-type frame)
Whenever an "authorized" User comes back to my tab app,
he should be automaticaly redirected to the same "member's only" page.
(I suppose if I have an example for the previous steps,
I won't have a problem figuring this out)
Building app for canvas is the same as making it for Page tab. The only difference is the so called "fangate" (liker/non-likers).
This can be used out of the box only on page tabs and the only thing you need is to decode the signed request passed by facebook.
There is good explanation for doing this with C# here:
Decode Signed Request Without Authentication
I have found many examples of getting data from facebook manually.
Is there a way to grab the data using an application (not a web app)?
What we are doing is creating a data repository for our customers so they can look at their data from FB, GA, twitter ect all in one place.
Facebook has me stuck as I can get an authentication code, but none of the URLs such as https://graph.facebook.com/me/friends?access_token=... will work. Guessing because "me" means I need to be logged into my site for it to work.
Any help/examples would be great.
Thank You
It sure is a pain to prune a Facebook profile. Is there any way using the Facebook API (or some other mechanism) to authenticate as a particular user and remove friends from the user's list? I have looked through the API documentation, but I'm not familiar with the ins and outs of the platform.
I have been through the complete facebook graph api documentation on facebook while i was writing my open source .net sdk for facebook. From all that i understand, i am 99.9 % sure that this cannot be done using their api. You can create status messages, links, photos, albums, events, pages, notes etc using their api ( you need to perform simple post operations for all this ), but i have read no where that a friend can be removed using facebook api !
No API but you can program your browser or mimick a browser. Think of QtWebKit. I doubt if you need to add so many friends and just to remove them using machine.
I am thinking about working with remote data and receive or send data actually in external web sites. exists a large amount of examples in World Wide Web are working. For example: free online web tools like web stats OR Google's AdSense .... .you know in such web services some code will generate for publishers and the publisher put generated code in her BODY of web page document(HTML file) and the system after that will work. we can have count of visits for home pages, count of clicks on advertisements and so on.now this is my question: How such systems Work? and how can I investigate and search about them to find out how to program them? can you suggest me some keywords? Which Titles should I looking for? and which Technologies is relevant to this kind of programming? Exactly I want to find some relevant references to learn and start some experiences on these systems. if my Q is not Clear I will Explain it more if you want...Help me I am confused.
Consider that I am an Programmer want to program such a systems not to use them.
There are a few different ways to track clicks.
Redirection Tracking
One is to link the advertisement (or any link) to a redirection script. You would normally pass it some sort of ID so it knows which URL it should forward to. But before redirecting the user to that page it can first record that click in a database where it can store the users IP, timestamp, browser information, etc. It will then forward the user (without them really knowing) to the specified URL.
Advertisement ---> Redirection Script (records click) ---> Landing Page
Pixel Tracking
Another way to do it is to use pixel tracking. This is where you put a "pixel" or a piece of Javascript code onto the body of a webpage. The pixel is just an image (or a script posing as an image) which will then be requested by the user visiting the page. The tracker which hosts the pixel can record the relevant information by that image request. Some systems will use Javascript instead of an image (or they use both) to track clicks. This may allow them to gain slightly more information using Javascript's functions.
Advertisement ---> Landing Page ---> User requests pixel (records click)
Here is an example of a pixel: <img src="http://tracker.mydomain.com?id=55&type=png" />
I threw in the png at the end because some systems might require a valid image filetype.
Hidden Tracking
If you do not want the user to know what the tracker is you can put code on your landing page to pass data to your tracker. This would be done on the backend (server side) so it is invisible to the user. Essentially you can just "request" the tracker URL while passing relevant data via the GET parameters. The tracker would then record that data with very limited server load on the landing page's server.
Advertisement ---> Landing Page requests tracker URL and concurrently renders page
Your question really isn't clear I'm afraid.
Are you trying to find out information on who uses your site, how many click you get and so one? Something like Google Analytics might be what you are after - take a look here http://www.google.com/analytics/
EDIT: Adding more info in response to comment.
Ah, OK, so you want to know how Google tracks clicks on sites when those sites use Google ads? Well, a full discussion on how Google AdSense works is well beyond me I'm afraid - you'll probably find some useful info on Google itself and on Wikipedia.
In a nutshell, and at a very basic level, Google Ads work by actually directing the click to Google first - if you look at the URL for a Google ad (on this site for example) you will see the URL starts with "http://googleads.g.doubleclick.net..." (Google own doubleclick), the URL also contains a lot of other information which allows Google to detect where the click came from and where to redirect you to see the actual web site being advertised.
Google analytics is slightly different in that it is a small chunk of JavaScript you run in your page, but that too basically reports back to Google that the page was clicked on, when you landed there and how long you spend on a page.
Like I said a full discussion of this is beyond me I'm afraid, sorry.