douyan8772 2014-01-25 11:42
浏览 182
已采纳

使用facebook profile profile(如profilepic,brthday等)为用户墙生成图像

Hellow guys am new to facebook app development.I am trying to develop an application which generates an images when a user gives the app a permission to his/her profile.I have serached many times but i didnt get any useful information.

I have came across gd library too but i didnt get how to use gd library in generating images with facebook statistics like no of messages,profile pic images etc .

I have seen a lot of apps like this ..I can show you what i mean .Just look the link below to see the image ..

http://s30.postimg.org/a37uy9qzl/554327_429089617163509_20686672_n.jpg

and yeah this is the same thing i want to do .i want to make an app which generates a background image and in that background image i want to add some text and display the profile picture who use the app and the other is the any person from the friend list

<?php
require'facebook.php';

   $app_id = "606714542734115";
   $app_secret = "3501a1caf56a888b02d8f2d7301337ec";
   $post_login_url = "https://apps.facebook.com/bestfriendzzz
   $album_name = 'BEST FRIENDS';
   $album_description = 'A COOL APPLICATION FOR FINDING YOUR BEST FRIEND';

  $attachment= array('message' => "message",
        'name' => 'name',
        'caption' => "caption",
        'link' => 'some URL address',
        'picture' => {
   "error": {
      "message": "(#803) Some of the aliases you requested do not exist: PROFILE_ID_NUMBER",
  "type": "OAuthException",
  "code": 803
   }

});


        $headers = get_headers("https://graph.facebook.com/$fbid/picture?type=large");
$image_loc = $headers[5];
?>

This is just a code sample that i have done .I am stuck with this .Please guide me how to do this.Code samples are appreciated and thanks in advance .:)

  • 写回答

2条回答 默认 最新

  • dqmdlo9674 2014-01-25 15:48
    关注

    first here's a code that will upload an image to facebook

    include 'facebook/libs/facebook.php';
    $config = array();
    $config['appId'] = 'yourappid';
    $config['secret'] = 'yourappimage';
    $config['fileUpload'] = true;
    
    $facebook = new Facebook($config);
    $user_id = $facebook -> getUser();
    $photo = "http://www.acnologia.com/staticimage.php?m=7090032"; // url of the image generated using php gd library
    $message = "hola mundo";
    
    if ($user_id) 
    {
    
    
    
    $upload_photo = $facebook->api('/me/photos', 'POST', array(
                                         'url' =>  $photo,
                                         'message' => $message,
                                         )
                                      );    
    
    
    
    
    
    }
    

    $config['fileUpload'] = true; //this line here is what you lack in your code that's why it doesn't upload

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大