New iOS developer here. I'm looking to build an app that uses a Wordpress database to populate a news feed, and I've found a good amount of info about grabbing posts from Wordpress but nothing about posting FROM the app TO the database. I know that the code can't be written here, but I was hoping someone knew where I could find how to do this or point me in the right direction. I planned on writing all of my new code in Swift also. Thanks in advance for any advice!
The easiest way to interact with Wordpress is by activating the jetpack api. You can then do almost anything you want. See the full documentation here: https://developer.wordpress.com/docs/api/
Reading data is easy. you only have to call the correct URL. If you wan to see a sample (written in swift) then have a look at:
https://github.com/evermeer/AlamofireJsonToObjects/blob/master/AlamofireJsonToObjectsTests/WordpressTest.swift
If you want to make updates, then you need to use Oauth2. Here are some libraries that could help with that: https://cocoapods.org/?q=oauth
Related
So I've searched the web end on end looking for just the steps to get me in the right direction but can't seem to find it.
So what i'm trying to do is as follow:
Create a web application with php that has simple functionality.
Functionality as follows:
Firstly - It needs to go check a public facebook group to see if the group itself has made a post, and if so the app needs to return a circle. The circle will be an indication that there's been a public post.
Secondly - If there's been no public post it needs to display a different color circle.
Thirdly - if there were no schedule posts for that day it needs to display another different color circle.
I'm trying to do this WITHOUT facebook graph API and without access tokens. As far as i understand there's no need for tokens as its a public group making public posts.
I've also read up a but about php-curl but so far I can't manage to get what i'm looking for.
All i ask for is guidance in the right direction or what you can offer me.
Thanks in advance for your help.
Using the API is the suggested method but if you really want to scrape post info you can try https://pastebin.com/QjxN0ZUY
This part in the code is where you define the regex of what you want to extract, in this demo I have just extracted the date of the post as it was the easiest.
$searchREGEX = '/\<abbr\>(.|\n)*?\<\/abbr\>/';
Hope this helps, good luck !
you can try what #zac is suggesting you can also try and use 1 or more scraping methods.
for me i scrape sometimes with PHP-curl and the Dom Document to read what i get. this can be heavy because you need to pull the web page every x amount of time.
Next what i use also for testing but is suitable for web scraping or just going on other sites is Panther (https://github.com/symfony/panther) this uses a web browser so you can also incorporate some sort of screenshot system to see if you have the right data ()
I'm trying to find some information/documentation on creating a custom Facebook feed for any website. (Custom css etc) but there is nearly nothing to find. I want to read posts from a public facebook page and display them on my website in an owl carousel.
The only guide I found was outdated since facebooks developers page completely changed and the other guides are all for Wordpress.
Does anyone know any good guides, or can anyone help me in the good direction?
Thanks
Example code and information can be found in the API reference:
https://developers.facebook.com/docs/graph-api/reference/page/feed#read
I suggest using an App Token on the server, it is valid forever. If you don´t know about the different Tokens, here are some links:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Side Note: To get pictures, you can use the full_picture field: /page-id/feed?fields=full_picture
i have seen many examples on Google but all related to zendframe work but I want it in core php only. I am giving some links below on those links explained how to use but its also in zendframe work.
http://www.ibm.com/developerworks/xml/library/x-googledata1/index.html?ca=drs-
http://www.ibm.com/developerworks/opensource/library/x-googledata2/index.html?ca=drs-
Please gives response ASAP
Thanks in advance.
After much struggle with getting Facebook to yield it's RSS feed for a page, it seems as though my futility levels have reached their peak.
JSON seems to work absolutely dandy for me and so to this end I am curious as to whether there are any plugins that would import FB JSON as blog posts since it seems that RSS XML's either going away or seriously b0rked. Can anyone recommend any plugins to accomplish this?
Another way to import facebook post in your blog is to use http://www.social2blog.com/ but work only with facebook page. Otherwise you can create your own php script:
get the post in json format from Facebook ( https://developers.facebook.com/docs/graph-api/reference/v2.0/post ) but first you need to know how get access token.
for each facebook post insert a relative wordpress post using wp_insert_post
Unfortunately after having suspicions confirmed, Facebook has killed this feature. A solution has been recommended here: https://stackoverflow.com/a/9778635/320681
Do you mean something like this: FeedWordPress.
It syndicates content from feeds that you choose into your WordPress weblog. Hope it helps
I have a non-programming answer to this old question. I'm adding it here in case it helps. OK, I started looking for complicated programming solutions involving SDKs and APIs or even plain old WordPress plugins. But it's frustrating, especially as there's a lot of out of date information out there.
It's really simple. Just use IFTTT. I had to create two recipes, one for normal FB posts and one for FB photo posts. But both worked right away, the FB posts appeared as plain WP posts in my WordPress dashboard, absolutely no problem and surprisingly simple.
Create an app then get proper permission from page admin to read the facebook page feed.Refer this documentation.
https://developers.facebook.com/docs/reference/api/
Problem with this method is you have to run a cron job and pull the data from Facebook.
I'm trying to make a Facebook application that utilises the multi-friend-selector to let someone answer a question. (eg: why do you think is the most awesome? you get multi friend selector below, choose someone and click post to his wall).
I've the post to wall part working fine using PHP. Right now though the friend to be asked a question is picked randomly.
Now the question. Is there a way to use PHP to render a multi-friend-selector or do i HAVE to go back and do this whole thing using Javascript?
The multi-friend-selector is under Facebook's control and you cannot use for anything other than sending invitations. So unfortunately you'd have to use your own. Fortunately though, someone else already had this problem and wrote one for you: Facebook – Friends selection custom component. Note that it does use some JavaScript.