danielcoker/larasap
Composer 安装命令:
composer require danielcoker/larasap
包简介
Laravel social auto posting (Larasap) lets you automatically post all your content to social networks such as Telegram Channel and Twitter.
README 文档
README
🌈 Introduction
This is a Laravel package to post your content to social networks such:
- Telegram Channel (Based on Telegram Bot API)
🚀 Features:
- 🍒 Simple. Easy to use.
- 📝 Send text message to Telegram channel
- 📷 Send photo to Telegram channel
- 🎵 Send audio to Telegram channel
- 📖 Send document to Telegram channel
- 📺 Send video to Telegram channel
- 🔊 Send voice to Telegram channel
- 🎴 Send a group of photos or videos as an album to Telegram channel
- 📍 Send location to Telegram
- 📌 Send venue to Telegram
- 📞 Send contact to Telegram
- 🌐 Send message with url inline keyboard to Telegram channel
- ✨ Send text and media to Twitter
- 🎉 Send text and media to Facebook
🔨 Installation:
- Download and install package via composer:
composer require toolkito/larasap
- Run the command below to publish the package config file:
config\larasap.php
php artisan vendor:publish --tag=larasap
🔌 Configuration:
Set the social network information in the config\larasap.php.
🕹 Usage:
First, add the use Toolkito\Larasap\SendTo; in your controller.
Next, send message to your Telegram channel or Twitter account.
🚩 Roadmap
- Improve tests and coverage
- Improve performance
🌱 Quick examples:
⭐ Telegram examples:
📝 Send text message to Telegram:
SendTo::Telegram('Hello, I\'m testing Laravel social auto posting');
📷 Send photo to Telegram:
SendTo::Telegram( 'Hello, I\'m testing Laravel social auto posting', // Photo caption (Optional) [ 'type' => 'photo', // Message type (Required) 'file' => 'https://i.imgur.com/j6bzKQc.jpg' // Image url (Required) ], '' // Inline keyboard (Optional) );
🎵 Send audio to Telegram:
SendTo::Telegram( 'Hello, I\'m testing Laravel social auto posting', // Audio caption (Optional) [ 'type' => 'audio', // Message type (Required) 'file' => 'http://example.com/let-me-be-your-lover.mp3', // Audio url (Required) 'duration' => 208, // Duration of the audio in seconds (Optional) 'performer' => 'Enrique Iglesias', // Performer (Optional) 'title' => 'Let Me Be Your Lover' // Track name (Optional) ], '' // Inline keyboard (Optional) );
📖 Send document to Telegram:
SendTo::Telegram( 'Hello, I\'m testing Laravel social auto posting', // Document caption [ 'type' => 'document', // Message type (Required) 'file' => 'http://example.com/larasap.pdf', // Document url (Required) ], '' // Inline keyboard (Optional) );
📺 Send video to Telegram:
SendTo::Telegram( 'Hello, I\'m testing Laravel social auto posting', // Video caption (Optional) [ 'type' => 'video', // Message type (Required) 'file' => 'http://example.com/let-me-be-your-lover.mp4', // Audio url (Required) 'duration' => 273, // Duration of sent video in seconds (Optional) 'width' => 1920, // Video width (Optional) 'height' => 1080 // Video height (Optional) ], '' // Inline keyboard (Optional) );
🔊 Send voice to Telegram:
SendTo::Telegram( 'Hello, I\'m testing Laravel social auto posting', // Voice message caption (Optional) [ 'type' => 'voice', // Message type (Required) 'file' => 'https://upload.wikimedia.org/wikipedia/en/9/9f/Sample_of_%22Another_Day_in_Paradise%22.ogg', // Audio url (Required) 'duration' => 28 // Duration of the voice message in seconds (Optional) ], '' // Inline keyboard (Optional) );
🎴 Send media group to Telegram:
SendTo::Telegram( null, [ 'type' => 'media_group', // Message type (Required) 'files' => // Array describing photos and videos to be sent, must include 2–10 items [ [ 'type' => 'photo', // Media type (Required) 'media' => 'https://i.imgur.com/j6bzKQc.jpg', // Media url (Required) 'caption' => 'Laravel sccial auto posting' // Media caption (Optional) ], [ 'type' => 'video', // Media type (Required) 'media' => 'http://example.com/let-me-be-your-lover.mp4', // Media url (Required) 'caption' => 'Let me be your lover' // Media caption (Optional) ] ] ] );
📍 Send point on the map to Telegram:
SendTo::Telegram( null, [ 'type' => 'location', // Message type (Required) 'latitude' => 36.1664345, // Latitude of the location (Required) 'longitude' => 58.8209904, // Longitude of the location (Required) 'live_period' => 86400, // Period in seconds for which the location will be updated (Optional) '' // Inline keyboard (Optional) );
📌 Send information about a venue to Telegram:
SendTo::Telegram( null, [ 'type' => 'venue', // Message type (Required) 'latitude' => 36.166048, // Latitude of the location (Required) 'longitude' => 58.822121, // Longitude of the location (Required) 'title' => 'Khayyam', // Name of the venue (Required) 'address' => 'Neyshabur, Razavi Khorasan Province, Iran', // Address of the venue (Required) 'foursquare_id' => '', // Foursquare identifier of the venue (Optional) '' // Inline keyboard (Optional) );
📞 Send phone contacts to Telegram:
SendTo::Telegram( null, [ 'type' => 'contact', // Message type (Required) 'phone_number' => '+12025550149', // Contact's phone number (Required) 'first_name' => 'John', // Contact's first name (Required) 'last_name' => 'Doe', // Contact's last name (Optional) '' // Inline keyboard (Optional) ] );
🌐 Send message with inline button to Telegram:
SendTo::Telegram( 'Laravel social auto posting', '', [ [ [ 'text' => 'Github', 'url' => 'https://github.com/toolkito/laravel-social-auto-posting' ] ], [ [ 'text' => 'Download', 'url' => 'https://github.com/toolkito/laravel-social-auto-posting/archive/master.zip' ], ] ] );
Or
SendTo::Telegram( 'Laravel social auto posting', '', [ [ [ 'text' => 'Github', 'url' => 'https://github.com/toolkito/laravel-social-auto-posting' ], [ 'text' => 'Download', 'url' => 'https://github.com/toolkito/laravel-social-auto-posting/archive/master.zip' ], ] ] );
⭐ Twitter examples:
✨ Text tweet:
SendTo::Twitter('Hello, I\'m testing Laravel social auto posting');
✨ Tweet with media:
SendTo::Twitter( 'Hello, I\'m testing Laravel social auto posting', [ public_path('photo-1.jpg'), public_path('photo-2.jpg') ] );
⭐ Facebook examples:
🎉 Send link to Facebook page:
SendTo::Facebook( 'link', [ 'link' => 'https://github.com/toolkito/laravel-social-auto-posting', 'message' => 'Laravel social auto posting' ] );
🎉 Send photo to Facebook page:
SendTo::Facebook( 'photo', [ 'photo' => public_path('img/1.jpg'), 'message' => 'Laravel social auto posting' ] );
🎉 Send video to Facebook page:
SendTo::Facebook( 'video', [ 'video' => public_path('upload/1.mp4'), 'title' => 'Let Me Be Your Lover', 'description' => 'Let Me Be Your Lover - Enrique Iglesias' ] );
danielcoker/larasap 适用场景与选型建议
danielcoker/larasap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「twitter」 「facebook」 「laravel」 「social network」 「telegram」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 danielcoker/larasap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 danielcoker/larasap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 danielcoker/larasap 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Simple Twitter API wrapper
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
A helper module for pdf-print, print and social share functionality based on bootstrap to custom modules.
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-04