I have an online blog which is custom written, by myself, with PHP. The articles & other features publish themself on a predefined date, which means that I can have 2 months of future content already lined up & writen, meaning that the site is constantly updating itself without my assistance.
Now I want to be able to update the facebook page, asociated with the blog, automatically. Is it possible to do this? All I want is for a new status to be made every time a new article is published, without me having to do it manually.
Any help would be great.
You would need to set-up a cron job (Scheduled task) to make this possible. This can be viewed in the administrative panel.
You need to assign a (cron) file that lets you check your articles publishing date and today's date.
Have you looked into facebook's api and what it could do with facebook pages. I have never tried exactly what you want to do, but from my experience it seems that is very likely. I know you can automatically request an access_token and use that to publish updates onto a pages wall.
I think the combination of these two articles is what you are looking for:
How to update a facebook page status using the facebook api
X
Update your Facebook status using PHP and Graph API
Related
Imagine I want to store in my database the facebook posts from a user/page for getting them and manipulate them simplier.
I will make a php script that will be launch every day for each user/page who will get the posts I don't already have in my database and insert them.
Now, on my front website, you can log in, and see your posts.
Now, you go on facebook, and modify one of your post.
Now you come again on my website, and obviously, you don't see the modification you did on facebook, because this modification is on facebook database and not in mine, and your posts a retrived from my Database.
Theorically, one of the solution will be that facebook has a "log" table for posts, where i can find something like "this posts has be updated" so i can update my table. Something like that exist ?
If not i have a second solution, at each posts send from my server to my website, update it automatically with facebook database (getById the post on fb an update it in my db) and after that send the posts to my website. But this will be a mess and a lot of request for nothing.
So how can i do this ? Someone have already tried this ? Or only directly manage the posts from facebook database ?
Thanks =)
Facebook has a mechanism to send updates to you, called webhooks.
https://developers.facebook.com/docs/graph-api/webhooks
You can subscribe to several fields for users or pages, among them the feed.
You’ll have to check if it delivers updates to already existing posts as well - but I think it should, would make little sense if it didn’t.
I have a website where users can post jobs for free. How can I link these posts to a facebook page about this website? I don't want the users to login to fb.
At this moment I post them to twitter and then using selective tweets to post them on my page. But selective tweets is not able to post logo's specific for that job.
I created a fb app. Did not select anything just gave it a name and got an appID and appSecret. I dont now what to select in "Select how your app integrates with Facebook". Becouse it is not a mobile app and it is not a website with fb login.
Kind regards.
you can use share on facebook facility of facebook ,from http://developer.facebook.com.
you can easily add this to your website.
have fun!
You can do this easily via MYSQL and PHP, depending on how your current site is setup. What i would do is store the jobs into a separate table while saving, like this
(table) Facebook
pageid //numerical value
header //job title
message //job description
So that you can use it for the next part.
Create an application via Facebook and give it authentication to users and your Facebook page.
by adding this application to your page you can then call something like :
$facebook->set_user($user, $session_key);
$facebook->api_client->stream_publish($item['header'], $item['message'], $item['pageid']);
Using your keys from facebook.
Then you can run a Cron that updates every x minutes, and after it has posted it, in an array, you can clear the table for the next row of jobs.
Let me know where you are on this and ill try to help as much as possible.
Is there a permission that will allow me to update the privacy of a user's news feed item (status update), or delete it. In the manual there is only documentation on how to delete posts that your application made. I can understand this, as I wouldn't want an application I'd installed messing with my posts in such a way that was not easy to trace.
However, my use-case is this. Stuck with a timeline where everyone can see my old posts, I had to put everyone on the restricted list. I'd like to change the visibility of all my posts so that only I can see them, and no-one else and then take everyone off restricted.
So, is there some way I can do this using the API?
Updating a post's privacy or deleting posts made by a different app aren't available via the API. I spent hours cleaning this all up manually when timeline launched, and then I just ended up deactivating my account anyways. The only way to do this programmatically would be to scrape their site or write some kind of greasemonkey script, both of which would probably violate their terms of service.
I want to update a no_comments row in a database exactly when a facebook comment on my site is made. I would like to do the same thing for likes as well.
I can imagine setting up a cron job that uses the graph API to periodically retrieve the number of comments and likes and update the database but for a large number of objects that are associated with comments the lag introduced is undesirable.
I am not looking for someone to "code a solution" for me...rather can someone point me in the right direction: is it possible to use AJAX to somehow update the database at the point when a comment is made or a like is done?
I can see how one can use the click event for the like button but it's not fool proof...
All help is appreciated!
Assuming you are using Oauth and have a facebook application then I would consult the facebook API docs for events or triggers. If a method exists it will be in the API docs.
Your description of your "site" is vague so it is hard to understand what your site or how it connects to facebook.
Edit:
I wish people would explain down votes. I can't fix it if I don't know what the issue was.
I followed my own advice and searched for this "facebook run script when like is clicked" on Google and found this: enter link description here This is almost the same question except it deals with "like" buttons rather than comments.
You can generate "events" like I had previously suggested. So further consultation of the FB API may be the most fruitful way of finding out if there are events around "comments" as well as "likes".
Maybe the OP knows this, but there are several APIs (last time I checked) to facebook including Javascript methods that could be used in an Ajax manner. However, without further details of their website implementation there is no way to tell.
Hi i am trying to use Realtime updates in facebook application,
My application basically backs up the user's photos, messages and friendlist, i want when a user adds a new friend data on server should also be updated, when a user adds a new album the most recent album should be downloaded automatically to my server
I got this code from github-php , but dont know what next?
Please help if anyone has done with real time updates
you need to query the code after certain interval which you can use AJAX to update the page without refresh.
There is no automatic updates without query the information every time.
You have to subscribe using one module and you specify a callback url during the subscription... you only subscribe once and you get updates for everyone who has authorized your app. The updates come to you via the callback url and its very crappy info that basically tells you that you have to go back and query fb to get the full details.