1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Facebook - post on group wall by chron job

Discussion in 'Facebook API' started by webmasterone, Apr 7, 2014.

  1. #1
    Hallo everyone

    I've a PHP script that publish on a group (my group, i'm the admin) a news everytime a new one come, with an image

    the script is run by a chron job

    all worked perfectly since the new facebook restiling (some days)

    at the moment the news are published, the images not.

    this is the script i'm using.

    can someangelone kindly help me to correct in a such way that it works ?

    (the one that is not published is the $image passed in the function (7° value, the value is the url of the existing image into the server)

    MANY THANKS

    ------------------------ PHP Script ----------------------------

    function posta_facebook( $messaggio , $titolo , $caption , $link_name , $action_link , $testo , $image, $dest_post) {


    // Integrare la Facebook Library
    // include ("Facebook-Platform");

    $config = array();
    $config['appId'] = 'Here_App_ID';
    $config['secret'] = 'Here_Secret';
    $config['fileUpload'] = false; // optional

    $facebook = new Facebook($config);


    // Ottenere l'Application Token
    $contents = "https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=".FACEBOOK_APP_ID."&client_secret=".FACEBOOK_SECRET;
    $site_token = file_get_contents($contents);


    $source_uid = "The_Source_ID"; // ID di chi pubblica (ID della pagina o del proprio profilo)

    $target_uid = "Group_ID"; // ID della pagina o del proprio profilo



    // Inviare il messaggio ( Stream Publish )
    $url_facebook = "https://api.facebook.com/method/stream.publish?message=".$messaggio."&attachment={\"name\":\"".$titolo."\",\"href\":\"".$action_link."\",\"caption\":\"".$caption."\",\"description\":\"".$testo."\",\"media\":[{\"type\":\"image\",\"src\":\"".$image."\",\"href\":\"".$action_link."\"}]}&action_links=[{\"text\":\"".$link_name."\",\"href\":\"".$action_link."\"}]&target_id=".$target_uid."&uid=".$source_uid."&".$site_token."";
    // echo $url_facebook."<br>";
    simplexml_load_file("".$url_facebook."");

    }

    ------------------------ END PHP Script ----------------------------
     
    webmasterone, Apr 7, 2014 IP
  2. naisch

    naisch Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    you checked your developers account? maybe fb placed a restriction on photos published by your app?
     
    naisch, Jul 15, 2014 IP
  3. webmasterone

    webmasterone Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    ok, can u help to to understand how and what have i to check in my app.
    I did it a lot of time ago, following a tutorial in the internet, so now i have the doubt that changing something will beak my app
     
    webmasterone, Jul 15, 2014 IP
  4. naisch

    naisch Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    login your developers account and check if there are any alerts...if not check the permissions, I think fb is more strict lately...is it your own app you setup or from someone else?
     
    naisch, Jul 15, 2014 IP
  5. webmasterone

    webmasterone Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    it's on my fb probile, made by me
    i've two alerts, but all are marked as solved.
    upload_2014-7-15_20-46-43.png

    and these are the settings...

    upload_2014-7-15_20-47-38.png
     
    webmasterone, Jul 15, 2014 IP