Jump to content

Search the Community

Showing results for tags 'autopost'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Informatii generale
    • Anunturi importante
    • Bine ai venit
    • Proiecte RST
  • Sectiunea tehnica
    • Exploituri
    • Challenges (CTF)
    • Bug Bounty
    • Programare
    • Securitate web
    • Reverse engineering & exploit development
    • Mobile security
    • Sisteme de operare si discutii hardware
    • Electronica
    • Wireless Pentesting
    • Black SEO & monetizare
  • Tutoriale
    • Tutoriale in romana
    • Tutoriale in engleza
    • Tutoriale video
  • Programe
    • Programe hacking
    • Programe securitate
    • Programe utile
    • Free stuff
  • Discutii generale
    • RST Market
    • Off-topic
    • Discutii incepatori
    • Stiri securitate
    • Linkuri
    • Cosul de gunoi
  • Club Test's Topics
  • Clubul saraciei absolute's Topics
  • Chernobyl Hackers's Topics
  • Programming & Fun's Jokes / Funny pictures (programming related!)
  • Programming & Fun's Programming
  • Programming & Fun's Programming challenges
  • Bani pă net's Topics
  • Cumparaturi online's Topics
  • Web Development's Forum
  • 3D Print's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber


Skype


Location


Interests


Occupation


Interests


Biography


Location

Found 1 result

  1. M-am saturat sa tot postez pe pagina de facebook manual si m-am decis sa fac un script care sa posteze pe facebook automat o poza cu mesaj folosind cron. <?php require_once("/var/www/facebook/post/facebook-php-sdk-master/src/facebook.php"); $token_file = file_get_contents("token.txt"); $page_id = 45336456546456; $message = 'Post test'; $img_path = '/var/www/facebook/post/1.jpg'; $config = array(); $config['appId'] = '435646456456'; $config['secret'] = '456456dfge56t4e5tgedrg546te'; $config['fileUpload'] = true; $fb = new Facebook($config); $user_id = $fb->getUser(); if($user_id) { //comment this line after application approval if(empty($token_file)){ $json_response = file_get_contents("https://graph.facebook.com/me/accounts?access_token=".$fb->getAccessToken()); $decoded = json_decode($json_response, TRUE); foreach($decoded['data'] as $k => $v){ if(in_array($page_id, $v)){ file_put_contents("token.txt", $v['access_token']); } } } else { $params = array( "access_token" => $token_file, "message" => $message, "source" => "@" . $img_path, ); try { $ret = $fb->api('/'.$page_id.'/photos', 'POST', $params); echo 'poza uploadata'; var_dump($ret); } catch(Exception $e){ echo $e->getMessage(); } } } else { //comment this line after application approval $login_url = $fb->getLoginUrl( array( 'scope' => 'manage_pages,publish_stream') ); //comment this line after application approval echo 'Please <a href="' . $login_url . '">login.</a>'; //comment this line after application approval } //comment this line after application approval ?> Scriptul este departe de a fi perfect dar functioneaza dupa cum urmeaza: 1. inlocuiti variabile "page_id" cu id-ul paginii/contului 2. creati aplicatia in facebook developer si inlocuiti "appId" si "secret" 3. in setarile aplicatie trebuie sa adaugati adresa url unde va fi pus scriptul 4. creati fisierul "token.txt" cu drepturi de citire/scriere (se va stoca token-ul pt publicarea offline) 5. accesati pagina, apasati log in, acceptati aplicatia (de 3 ori ar trebui sa apara) 6. dupa care comentati liniile care contin comentul "comment this line after application approval" 7. puneti un cron din ora in ora ca de ex: 10 * * * * /usr/bin/php /var/www/script.php Have fun.
×
×
  • Create New...