Upload Post to Facebook Automatically in PHP - 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/

Related

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

Searching twitters public timeline using JQuery

So a while back I used to use the twitter json search in one of my apps but it seems since the change in API versions there has been some major changes which even after reading the documentation I still can't get my head around and it really doesn't make it very easy to understand so hopefully one of you tech guys out there can help me out.
I want to clean my application up so it works again in plainly doing the following:-
http://search.twitter.com/search.json?
q='+param+'&
rpp=100&
result_type=recent&
lang=en
Obviously with the changes this is no longer possible but I want to be able to do this again using the new address but in JQuery unless someone can suggest either a tutorial or a piece of code or even a link to a topic where I could get my answer. I'm also open to using PHP as this is what I used at one point with searching Facebook's timeline and you can get an access token using $.get() for Facebook so surely it would be the same with Twitter too?
Any advice/code is welcome.
Thanks!
the search API needs authorization now. I'd say that, first off, you need to call the https url not http.
With Abhramam William's library you'd do something like the following, after having received your app's bearer token:
$your_tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=from:grey_mina&result_type=recent&count=5");

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.

Can my website post to Facebook?

I have a PHP based website which has a post/comment system. Can I add a checkbox to my post function so that if it is checked the post will be published to Facebook as well as my own website at the same time?
I have looked through the docs on facebook and I saw a comment plugin, but it's not really what I am looking for.
I would appreciate a tutorial, links, code, or just general help.
If you're looking for a way to replicate the auto-posting functionality in the fb:comments plugin, the only way to accomplish that is asking the users to install an app. By using the sandboxed fb:comments social plugin, Facebook controls the user experience, so users can post to their wall without an install. If you use your own method though, you'll need to require an install (and publish_stream permissions).
I'd recommend using fb:comments if at all possible, since that creates less friction for your users and will be a more familiar experience for them. If you wish to do something with the comment as it's added, you can subscribe to the comment.create event.
May be you can use the Feed Dialog have a look: http://bit.ly/rQWC36
You can launch the dialog if the checkbox is checked, after submit the comments form.
Or may be you can use the OpenGraph API versiĆ³n of the feed dialog, look for the section: "Graph API Equivalent" documentation doesn't sais nothing about permission on using that dialog this way. I hope it helps.
I am still unsure of what you are looking for but still facebook api is a good place to start off. A part from that, the checkboxes and automatically going to facebook that you have referred will be done according to your language/framework which you have not illustrated.

How to Post to My Facebook Fan Page using PHP and Graph API?

i like to post to my FB Fan Page, Some Content using cron job in PHP,How can i do that?
Can you gave me example?
After becoming familiar with the Graph API check out Facebook's documentation for Pages
http://developers.facebook.com/docs/reference/api/page/
Here is the main page for Facebook's Graph API documentation
http://developers.facebook.com/docs/api
For PHP Development, check out this SDK, It will make your life much easier for interacting with Facebook using PHP
https://github.com/facebook/php-sdk/
Here is a link for how to configure your Facebook APP to be able to post on a Facebook Page
http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/
(I did not follow this exact tutorial but slaved to figure it out myself, so let me know how it works for you)
note As I mentioned in a below comment make special note of the permanent session key.

Categories