Giter Club home page Giter Club logo

laravel-social-auto-posting's Introduction

Build Status GitHub tag

🌈 Introduction

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

πŸš€ 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:

  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

πŸ”Œ 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'
    ]
);

laravel-social-auto-posting's People

Contributors

alihesari avatar karabayyazilim avatar ssesmaeeli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-social-auto-posting's Issues

conflict with other package

Will you please upgrade to the latest Illuminate support, as it make easy any package can use it since I am get conflict with other package which require different version. For time being is there way I can solve this error
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

- toolkito/larasap V1.2.2 requires illuminate/support 5.5.x|5.6.x -> found illuminate/support[v5.5.0, ..., 5.6.x-dev] but it conflicts with another require.
- toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> found illuminate/support[v5.6.0, ..., 5.7.x-dev] but it conflicts with another require.
- Root composer.json requires toolkito/larasap ^1.2 -> satisfiable by toolkito/larasap[V1.2.2, V1.2.3].

For Personal Pages

Not and issue, More a feature request,

is it possible for the package to allow for posting to a user instead of a page on facebook?

great package btw.
Bests

Laravel 8.x support

Problem 1
- toolkito/larasap V1.2.2 requires illuminate/support 5.5.x|5.6.x -> found illuminate/support[v5.5.0, ..., 5.6.x-dev] but it conflicts with another require.
- toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> found illuminate/support[v5.6.0, ..., 5.7.x-dev] but it conflicts with another require.
- Root composer.json requires toolkito/larasap ^1.2 -> satisfiable by toolkito/larasap[V1.2.2, V1.2.3].

Graph returned an error: Unknown path components: /me/feed

I tried api versions 2.11 and 3.0 both returning the Graph returned an error: Unknown path components: /me/feed. Could someone point out what I am doing wrong? Thanks Logan

I am attaching the screenshoots of my of the error and my code.
screen shot 2018-05-16 at 1 00 44 pm
screen shot 2018-05-16 at 1 03 01 pm

Dynamic access_token, not in config

Hello,
I have to handle multiple facebook pages and with your implementation, it's a little complicated because the page_access_token is in a configuration file.
It could be great to give the possibility to set it with a method parameter, to avoid to set the configuration value.
Thanks

PS : Same for twitter, if I handle multiple users, I can't hardcode the access_token and access_token_secret on the config file :(

Laravel 5.8 support

I'm upgrading my app to laravel 5.8
But this package is blocking it.
Please update it to work with Laravel 5.8

How to install on PHP version 8

I want to install the package on my existing Laravel project but it's showing the package require php 7 and I'm using php 8
I'm doing something or I can't use with version 8

Could not find a matching version of package toolkito/larasap

When trying to install the package via composer I get this message;
[InvalidArgumentException]
Could not find a matching version of package toolkito/larasap. Check the package spelling,
your version constraint and that the package is available in a stability which matches yo
ur minimum-stability (stable).
PHP version 7.1.12

L5.6 fail to send message to Telegram channels

Hi,
I'm trying to send text to both private and public channel, but I get this error :
an error was encountered

Here my Config:

'telegram' => [
        'api_token' => '1010......Qg6tpU',
        'bot_username' => 'xxxxx',
        'channel_username' => '-1001........8', // Channel username to send message
        'channel_signature' => 'xxxxxxxx', // This will be assigned in the footer of message
        'proxy' => false,   // True => Proxy is On | False => Proxy Off
    ],

Facebook: Graph returned an error: Unknown path components: /me/photos

larasap.php

<?php

return [

    'facebook' => [
        'app_id' => '***',
        'app_secret' => '***',
        'default_graph_version' => '3.0',
        'page_access_token' => '***'
    ]

];

Code:

        SendTo::Facebook(
            'photo',
            [
                'photo' => 'image_path',
                'message' => 'Test message'
            ]
        );

It returns,

Graph returned an error: Unknown path components: /me/photos

What's the problem here?

toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> satisfiable by illuminate

This package doesn't support Laravel 5.8.

It will. be better to update this package based on Laravel version.

 Problem 1
    - Conclusion: remove laravel/framework v5.8.7
    - Conclusion: don't install laravel/framework v5.8.7
    - toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> satisfiable by illuminate/support[5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].

lv 5.5 not supported yet?

Trying to install package on lv 5.5, but have some issue's.
So question, does this package support laravel 5.5 ?

Proy Type

Hi

can you give us example for http proxy or https
cause it's only mention socks5

notes

  • larasap facade is not used anywhere, so why its loaded ?
  • facebook/graph-sdk is already a dependency, so no need to re-install it
  • can u tag the package so we can install it, atm the only way is to add it manually and use composer update

Facbeook: Graph returned an error: Unknown path components: /me/feed

Hey there,

First of all I'm excited to try out your packages. Thanks for that! But unfortunately I'm getting the following error.

Error
Graph returned an error: Unknown path components: /me/feed

Setup
I followed your Set-Up on the documentation.

   'facebook' => [
        'app_id' => env('FACEBOOK_APP_ID'),
        'app_secret' => env('FACEBOOK_APP_SECRET'),
        'default_graph_version' => '2.11',
        'page_access_token' => env('FACEBOOK_ACCESS_TOKEN')
    ]

Code

use Toolkito\Larasap\SendTo;

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


        return view('dashboard.index');
    }

Cheers Stan

Twitter api

Would it be possible to fetch tweets from an account? and maybe reply to a specific tweet?

Laravel 8

toolkito/larasap V1.2.3 requires illuminate/support 5.6.x|5.7.x -> found illuminate/support[v5.6.0, ..., 5.7.x-dev] but these were not loaded, likely because it conflicts with another

Laravel 6.x support

I'm upgrading my app to Laravel 6.x
But this package is blocking it.
Please update it to work with Laravel 6.x

Installation compatibility with laravel 5.4.3

Hi ,
This package seems to be awesome but i am not able to get any benefit from it.
Can any body help me on this issue?

What i've tried for installation with this command

composer require toolkito/larasap

Update my composer to latest version
Update my php to latest version

But its not solution i guess may be i am missing something.

Full log on cmd.

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for toolkito/larasap ^1.2 -> satisfiable by toolkito/larasap[V1.2.2].
- Conclusion: remove laravel/framework v5.4.36
- Conclusion: don't install laravel/framework v5.4.36
- toolkito/larasap V1.2.2 requires illuminate/support 5.5.x|5.6.x -> satisfiable by illuminate/support[v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].
- don't install illuminate/support v5.5.0|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.16|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.17|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.2|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.28|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.33|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.34|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.35|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.36|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.37|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.39|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.40|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.41|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.43|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.6.0|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.6.1|don't install laravel/framework v5.4.36
- illuminate/support v5.6.10 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.11 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.12 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.13 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.14 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.15 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.16 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.17 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.19 conflicts with laravel/framework[v5.4.36].
- don't install illuminate/support v5.6.2|don't install laravel/framework v5.4.36
- illuminate/support v5.6.20 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.21 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.22 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.23 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.24 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.25 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.26 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.27 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.28 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.29 conflicts with laravel/framework[v5.4.36].
- don't install illuminate/support v5.6.3|don't install laravel/framework v5.4.36
- illuminate/support v5.6.30 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.31 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.32 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.33 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.34 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.35 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.36 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.37 conflicts with laravel/framework[v5.4.36].
- don't install illuminate/support v5.6.4|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.6.5|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.6.6|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.6.7|don't install laravel/framework v5.4.36
- illuminate/support v5.6.8 conflicts with laravel/framework[v5.4.36].
- illuminate/support v5.6.9 conflicts with laravel/framework[v5.4.36].
- Installation request for laravel/framework (locked at v5.4.36, required as 5.4.*) -> satisfiable by laravel/framework[v5.4.36].

Installation failed, reverting ./composer.json to its original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.