I have a php application.I want to manage my facebook profile from my application itself.
1)Logged in to facebook
2)Add comments
3)update my profile
etc.....
is it possible using facebook API.
Help is highly appreciated.
Thanks,
Companion
Yes it is possible. Have a look at this description of the Facebook Graph API, near the bottom is a section on publishing (you do it by sending POST request...):
http://developers.facebook.com/docs/api/
And here is their example for posting to someones wall:
curl -F 'access_token=...' \
-F 'message=Hello, Arjun. I like this new API.' \
https://graph.facebook.com/arjun/feed
And here is an exmaple of posting something to your own feed:
curl -F 'access_token=...' \
-F 'message=I am posting to my own feed. I am awesome.' \
https://graph.facebook.com/me/feed
Related
I would like an API in PHP for the direct link to download videos from social network VK.
Example:
(VK video link)
$source = 'https://vk.com/video-51189706_456246056';
(Through the source, generate direct links to all available video qualities)
$720p = 'https://psv49-7.daxab.com/cs1-67v4.vkuservideo.net/p18/8835b7e86c59.720.mp4';
$480p = 'https://psv49-7.daxab.com/cs1-67v4.vkuservideo.net/p18/8835b7e86c59.720.mp4';
Is it possible in PHP?
Assuming you have an access token, all you have to do is to perform a POST request at video.get method.
I am not familiar with PHP, but here is the simplest curl representation.
curl -X POST \
-d 'v=5.92' \
-d 'access_token=%YOUR_ACCESS_TOKEN%' \
-d 'videos=-51189706_456246056' \
https://api.vk.com/method/video.get
I am trying to access the following URL using cURL:
http://bizsearch.penrithcity.nsw.gov.au/eplanning/Pages/XC.Track/SearchApplication.aspx
However, when I attempt to access the web page I am redirected to:
http://bizsearch.penrithcity.nsw.gov.au/eplanning/Common/Common/terms.aspx
I tried utilizing the following cURL command to get passed this:
curl --cookie-jar "CookieTest.txt" url(common terms) -d "ctl00$ctMain1$chkAgree$chk1=on&ctl00$ctMain1$BtnAgree=I Agree"
curl --cookie "CookieTest.txt" url(search application)
Any help would be greatly appreciated as I am new to cURL and am having difficulty troubleshooting. I am wanting to pull the XML from the search application page.
I have an api to export some information to a csv file. The API is correct and it is downloading my file when I access it from the browser. I need to access this API from the terminal and download the file without having to go to the browser.
My route for the API looks like this:
Route::get('/api/file/export', 'File\FileController#export', [
'middleware'=>'auth.basic'
]);
I tried using curl like this:
curl --user email:password http://example.com/api/file/export
I have tried different curl commands but each of then displays the redirect to login html. When I use -O the command for downloading a file, it downloads a file that has the redirect to login link.
curl --user email:password -O http://example.com/api/file/export
Am I calling the API correctly? How else can I access the API from the terminal?
You should first be logged in your website. You can try this:
curl --user email:password http://domain.tld/login_page
And then use the cookies for your second request:
curl --cookie http://domain.tld/file/to/export
If that is not working, you need to do the whole submit action with cURL, meaning doing POST request with email and password etc.
Someone gave a good solution here
PS: Checkout if you don't need a token to request your API too.
I'm new to recess framework. Some how I have created RESTful web services with json. and my URL is like this
" curl -X POST http://www.example.com/example/skill.json -d {"skill":"name":"SuckingUp","jobCategory_id":"1","creator":"dwayne#test.com"},"u":"dwayne#test.com","p":"foo"}' ".
My question is how we can implement in our code or we can call from other application or we can integrate as web service. How we can call with cURL?.
I have no idea where I have to write the code.
I got stuck, please help me let out this.
Thanks,
Soeb
You can reach me # nasir_1823#yahoo.co.in
it sounds like you're looking for this:
http://php.net/manual/en/function.system.php
You use that command to call cURL in the system, and pass it whatever command line arguments you wish to execute.
I want to convert cURL command:
curl -F 'access=xxxx' \
-F 'message=Hello.' \
-F 'picture=#1.jpg' \
https://example.com
to a NSURLRequest.
Can somebody please help me with this?
If you want to create a request with POST data, I suggest you to use ASIHTTPRequest: http://allseeing-i.com/ASIHTTPRequest
It is quite powerful and easy to use, you should take a look at the ASIFormDataRequest class (see the How To Use section).
I've never used it for SSL connections though, but I'm pretty sure it's possible.