mysql - Facebook app that posts to all its users in a specific time (php) -
mysql - Facebook app that posts to all its users in a specific time (php) -
it's first question on stackoverflow. made application , works fine posting photo user's wall 1 time visit app page, but want post many photos in scheduled way (at specific time 12 feb 2013 10:00 pm) wall , users wall
i made mysql database contains table users' id, , table posts' info , time.
what can next?
include ("../facebook/facebook.php") ; $facebook = new facebook(array( 'appid' => app_id , 'secret' => app_secret , 'fileupload' => true, )); $user = $facebook->getuser(); if ($user) { seek { $user_profile = $facebook->api('/me'); } grab (facebookapiexception $e) { error_log($e); $user = null; } } if ($user) { $facebook->setfileuploadsupport(true); $photo ="images/image1.jpg" ; $message= "my message "; $ret_obj = $facebook->api('/me/photos', 'post', array( 'source' => '@' . $photo, 'message' => $message, ) ); $logouturl = $facebook->getlogouturl(); } else { $loginurl = $facebook->getloginurl(array( 'scope' => 'read_stream, publish_stream, photo_upload') ); }
@kareem : in simple words can have loop statement same.
for($i=0;$i<$upperlimit;$i++) { $photo ="images/image".$i."jpg" ; $message= "my message "; $ret_obj = $facebook->api('/me/photos', 'post', array( 'source' => '@' . $photo, 'message' => $message, ) ); }
$upperlimit limit , till planning post image on users wall.
note: can have set of images in location image1...imagen,so can loop around images while posting on user wall
if required can add together timer within loop delay
php mysql facebook facebook-graph-api
Comments
Post a Comment