You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, August 5th 2011, 2:50pm

Facebook OpenGraph Pinnwandeintrag

Source code

1
2
3
4
5
https://api.facebook.com/method/stream.publish?
message=*******************************************
&uid=***********************************************
&access_token=**********************************
&format=json


Folgende Sache ..
Wie ich an meine Pinnwand posten kann "verstehe" ich.

1. Das access_token .. Das was ich benutzt habe ist für mein eigenen Account.
Wenn aber ein anderer User mein App verwendet und dann auf meine Seite geht dann muss ich ein Token für diesen generieren, richtig?
Falls ja - jemand Denkanstöße?

2. Wenn ich "nur" mit der URL arbeiten will, dann brauch ich - um es lasch zusagen - nur file_get_contents(); richtig oder falsch?

Das waren eigentlich die zwei Fragen glaube ich.
Falls es noch was gibt melde ich mich.

Gruß

2

Saturday, August 6th 2011, 7:36pm

Keine eine Idee?
Das hingt ziemlich an meiner Arbeit ):

3

Sunday, August 7th 2011, 12:12pm

stream.publish ist kein OpenGraph, oder? Das ist die alte Rest API. Die wird aber abgeschafft

Quoted

Please note: We are in the process of deprecating the REST API, so if you are building a new application you shouldn't use this function. Instead use the Graph API and POST a Post object to the feed connection of the User object
http://developers.facebook.com/docs/refe…stream.publish/

Ich empfehle dir das Facebook SDK. Du findest es hier zum Download: https://github.com/facebook/php-sdk/
Konkret heißt die Open Graph Veriante von Stream.Publish glaube ich user/feed.

Beispiel (ungetestet):

PHP Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'php-sdk/src/facebook.php';
 
$facebook = new Facebook(array(
  'appId'  => 'YOUR_APP_ID',
  'secret' => 'YOUR_APP_SECRET',
));
 
// Get User ID
$user = $facebook->getUser();
 
if ($user) {
	$facebook->api("/$user/feed", 'post', array(
		'message' => "easy-coding ist toll.",
 
		'link'    => 'http://www.easy-coding.de',
		'picture' => 'http://www.easy-coding.de/banner88.gif',
		'name'    => 'Coder Forum für C++, Java, PHP, ...',
		'description'=> 'Die Plattform easy-coding besteht aus Forum, Wiki und zahlreichen Community-Projekten. easy-coding ist ein kostenloses Netzwerk VON Programmierern FÜR Programmierer. Praxisnahe Best-Practice-Lösungen helfen Euch beim Einstieg in komplexe Themen.'
	)
}

Similar threads

Social bookmarks