Question regarding publishing to a user's facebook feed - php

Currently I am building a small application that allows a user to sign in to their Facebook account and update their status from within the application.
However, the Facebook API does not seem well documented and I am having trouble locating sources of information that are relevant to the specific project that I am building.
Does anyone know of any articles that might be of use to me?
Thank you.

The documentation is there, scattered around and difficult to find, but there. These two links may help if you are looking to post to someone's wall. FB.ui is sort of a multi-purpose call that will present different dialogs, prompting the user for action. It's far easier to implement than it is find.
http://developers.facebook.com/docs/reference/javascript/
http://developers.facebook.com/docs/reference/javascript/fb.ui/

Related

Posting on Facebook Page on user's behalf

A team of some friends and I have come up with an app/product idea that we have been working on. I have to be vague on exactly what the details are, but hopefully I can explain it well enough to have the questions we have answered.
First, we have a web server with a database - we have developed all of the code for that in PHP. Each user will have a device which when an action is performed on the device, it sends a message to our server, and the PHP code on our server handles the message and stores the sent data in the appropriate fields in our database.
We want to run this through Facebook - we have an app and a Facebook page created for this. The idea is that when a user performs an action on his or her device and the message is sent to the server, the PHP code will automatically make a post on the Facebook page on the user’s behalf (not on the Page’s behalf).
Between all of us on working on this project, we have spent many days and many hours trying to figure out how to make the automatic post to the page. It’s extremely difficult googling this topic since all of the various examples are using different versions of the Facebook SDK (we are using the latest). There are lots of somewhat similar type questions/examples, but we can't find one that answers specifically what we are asking. In fact, we aren’t even sure that anybody but an ‘admin’ can post on a Facebook page with the new SDK, any longer. I do see this link in the Facebook developer section, https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed, where it says under the Publishing section:
Permissions
A user access token with publish_actions permission can be used to publish new posts on behalf of that person. Posts will appear in the voice of the user.
So, it sounds as if a user can post to the Facebook page if it is given an access token with publish_actions permission, yet we can’t find any example of code of this actually being done. Could anybody explain how to do the automatic posting to the page on a user’s behalf (hopefully, using PHP, since that is the language we are using on the server side), or at least point us to a good example? We are all experienced developers, but this is the first time any of us has done anything with Facebook development. So we certainly aren’t amateurs, but with Facebook development, we are. We may be overlooking something obvious, but after seeing so many links, my mind is jello.
A summary of our questions:
1. Can it even be done with the latest Facebook SDK that a post can be made to a Facebook Page for our product on the user’s behalf? (to be clear, we are talking about the Facebook Page we created for our app, not a user's page)
2. If so, what specific permissions do we need to give the user, just the publish_actions one? We don’t want to give the user too much permission to be able to screw up our page, of course.
3. Can this be done automatically with PHP from the server?
Any help would be GREATLY appreciated!

How to use Reddit's POST api?

I have managed to grab data from Reddit easily, displaying all links that users have submitted to a sub-reddit. What I want to achieve now though is to allow users of my site to login to reddit, and post to that sub-reddit from my site.
How would I achieve this using PHP?
I have searched the web everywhere and cannot seem to find anything that can help me. I am a begginer a PHP so it's quite confusing at times.
If there is an article explaining exactly what I want, I would be grateful if you could link me to it :)
Thank you!
EDIT: Documentation here; http://www.reddit.com/dev/api
I'd recomment to use/look into this opensource project on github (not my project). It uses curl to communicate and it might even be enough for you.
Another option would be to look into httpRequest::send and simply send your post variables with this method. This is if you like things to be more lowlevel.
The reddit api basically tells you what post parameters you need for which action

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.

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

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.

Is there a simple method using PHP for posting to Twitter without managing user logins or getting tweets?

I've seen there is some other discussion about this, however, none of the other threads I've read have targetted my situation.
For one, I do not need to get any Tweets from Twitter. I only need to send to Twitter.
For another, I don't need to have multiple accounts or different Twitter users. I can already ensure the page will only be seen by the one authorized user, so I can save any necessary login information in one configuration file and be done.
I am only posting occasionally from one web site, to one Twitter feed, and only one user will be logged onto the the web site that will send the tweet.
I am hoping to find a simple tutorial or script that can allow me to cut to the bare bones and just send tweets to my Twitter account.
However, all the tutorials and scripts I've seen so far have been too elaborate, handling logins, sessions, authenticating multiple users, and so on.
Is there any way I can get simple oAuth PHP code to accomplish what I'm describing?
This would help
http://code.google.com/p/dabr/source/browse/trunk/common/twitter.php
http://code.google.com/p/dabr/source/browse/trunk/common/OAuth.php
This should help or at least point you in the right direction.
https://dev.twitter.com/docs/twitter-libraries#php
You can use ZF component
get accessToken only once, keep it as serialized string anywhere
http://framework.zend.com/manual/en/zend.service.twitter.html

Categories