100

GitHub - toolkito/laravel-social-auto-posting: ?Laravel social auto posting

 6 years ago
source link: https://github.com/toolkito/laravel-social-auto-posting
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

68747470733a2f2f692e696d6775722e636f6d2f6a36627a4b51632e6a7067

rainbow Introduction

This is a Laravel package to post your content to social networks such:

rocket Features:

  • cherries Simple. Easy to use.
  • memo Send text message to Telegram channel
  • camera Send photo to Telegram channel
  • musical_note Send audio to Telegram channel
  • book Send document to Telegram channel
  • tv Send video to Telegram channel
  • loud_sound Send voice to Telegram channel
  • flower_playing_cards Send a group of photos or videos as an album to Telegram channel
  • round_pushpin Send location to Telegram
  • pushpin Send venue to Telegram
  • telephone_receiver Send contact to Telegram
  • globe_with_meridians Send message with url inline keyboard to Telegram channel
  • sparkles Send text and media to Twitter
  • tada Send text and media to Facebook

hammer Installation:

  1. Download and install package via composer:
composer require toolkito/larasap
  1. Run the command below to publish the package config file: config\larasap.php
php artisan vendor:publish --tag=larasap

electric_plug Configuration:

Set the social network information in the config\larasap.php.

joystick Usage:

First, add the use Toolkito\Larasap\SendTo; in your controller.

Next, send message to your Telegram channel or Twitter account.

triangular_flag_on_post Roadmap

  • Improve tests and coverage
  • Improve performance

seedling Quick examples:

star Telegram examples:

memo Send text message to Telegram:

SendTo::Telegram('Hello, I\'m testing Laravel social auto posting');

camera 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)
);

musical_note 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)
);

book 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)
);

tv 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)
);

loud_sound 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)
);

flower_playing_cards 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)
           ]
       ]
   ]
);

round_pushpin 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)
);

pushpin 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)
);

telephone_receiver 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)
    ]
);

globe_with_meridians 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'
            ],
        ]
    ]
);
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'
            ],
        ]
    ]
);

star Twitter examples:

sparkles Text tweet:

SendTo::Twitter('Hello, I\'m testing Laravel social auto posting');

sparkles Tweet with media:

SendTo::Twitter(
    'Hello, I\'m testing Laravel social auto posting',
    [
        public_path('photo-1.jpg'),
        public_path('photo-2.jpg')
    ]
);

star Facebook examples:

tada Send link to Facebook page:

SendTo::Facebook(
    'link',
    [
        'link' => 'https://github.com/toolkito/laravel-social-auto-posting',
        'message' => 'Laravel social auto posting'
    ]
);

tada Send photo to Facebook page:

SendTo::Facebook(
    'photo',
    [
        'photo' => public_path('img/1.jpg'),
        'message' => 'Laravel social auto posting'
    ]
);

tada 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'
    ]
);

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK