PHP code example of hamzahassanm / laravel-social-auto-post
1. Go to this page and download the library: Download hamzahassanm/laravel-social-auto-post library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hamzahassanm / laravel-social-auto-post example snippets
use FaceBook;
$caption = 'Check out this article!';
$url = 'https://example.com/post/123';
FaceBook::share($caption, $url);
use FaceBook;
$caption = 'Look at this amazing view!';
$imageUrl = 'https://example.com/images/view.jpg';
FaceBook::shareImage($caption, $imageUrl);
use FaceBook;
$caption = 'Watch this awesome video!';
$videoUrl = 'https://example.com/videos/video.mp4';
FaceBook::shareVideo($caption, $videoUrl);
use FaceBook;
// Fetch insights for page impressions and engagement
$metrics = ['page_impressions', 'page_engaged_users'];
$additionalParams = ['since' => '2024-01-01', 'until' => '2024-01-31'];
$insights = FaceBook::getPageInsights($metrics, $additionalParams);
use FaceBook;
$pageInfo = FaceBook::getPageInfo();
use Telegram;
$caption = 'Check out this article!';
$url = 'https://example.com/post/123';
Telegram::share($caption, $url);
use Telegram;
$caption = 'Here is a cool image!';
$imageUrl = 'https://example.com/images/cool_image.jpg';
Telegram::shareImage($caption, $imageUrl);
use Telegram;
$caption = 'Here is an important document!';
$documentUrl = 'https://example.com/files/document.pdf';
Telegram::shareDocument($caption, $documentUrl);
use Telegram;
$caption = 'Watch this video!';
$videoUrl = 'https://example.com/videos/video.mp4';
Telegram::shareVideo($caption, $videoUrl);