You are on page 1of 3

 

Facebook Platform
Publishing to Open Graph Pages
7/28/2010

 
 

 
Facebook Platform: Publishing to Open Graph Pages
 

 
 

Introduction  
This  article  describes  how  you  can  automatically  publish  to  all  users  who  have  liked  your  Open  
Graph  protocol    Web  page  (http://developers.facebook.com/docs/opengraph).  

Before  you  begin,  make  sure  you  have:    

• Included  all  the  Open  Graph  protocol  metadata  in  your  Web  page  
(http://developers.facebook.com/docs/opengraph).  
• Added  a  Like  button  to  your  Web  page  
(http://developers.facebook.com/docs/reference/plugins/like).  

Note:  You  must  specify  the  og:type  tag  in  order  to  publish.    However,  you  cannot  publish  to  
Facebook  if  your  Web  page's  object  type  is  set  to  article.  

• Verified  that  at  least  one  user  has  liked  your  Web  page.  

You  can  automatically  publish  stories  to  users  in  one  of  two  ways:  

• Using  the  application  ID  associated  with  the  Web  page    

Publishing  Using  an  Application  ID  


To  publish  on  behalf  of  a  Web  page  that  integrates  the  Open  Graph  protocol  using  an  application  ID,  
you  need  to  do  the  following:  

• Ensure  that  your  application  is  the  admin  of  the  Web  page.  
• Get  an  access  token  for  your  application  
• Publish  the  post.    

 Ensuring  your  application  is  the  admin  of  the  Web  page  
In  order  to  publish,  your  application  must  be  designated  as  an  admin  for  the  Web  page.    

2  
 
Facebook Platform: Publishing to Open Graph Pages
 

Get  the  application  ID  from  the  Facebook  Developers  application  


[http://www.facebook.com/developers/apps.php]  and  add  it  as  the  fb:app_id  meta  tag  to  the  Web  
page.  

   <head>    
       <meta  http-­‐equiv="Content-­‐Type"  content="text/html;  charset=UTF-­‐8"/>      
       ...    
       <meta  property="fb:app_id"  content="101189511127"  />    
       <meta  property="og:type"  content="blog"  />      
       ...              
   </head>  

Getting  the  access  token    


You  can  obtain  the  access  token  for  your  application  with:  

curl -F type=client_cred \
-F client_id=your_app_id \
-F client_secret=your_app_secret \
https://graph.facebook.com/oauth/access_token    

Publishing  the  post  


You  can  publish  using  the  Graph  API  and  an  access  token  with:  

curl -F 'access_token=...' \

-F 'message=Hello Likers' \

-F 'id=http://www.myopengraphpage.com/page1.html' \

https://graph.facebook.com/feed

 
 

3  
 

You might also like