guysolamour/laravel-hootsuite 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

guysolamour/laravel-hootsuite

Composer 安装命令:

composer require guysolamour/laravel-hootsuite

包简介

A package to interact with social networks via hootsuite api

README 文档

README

Packagist Packagist Packagist

Installation

Install via composer

composer require guysolamour/laravel-hootsuite

Publish spatie service provider laravel settings package

In case you are already using this package in your project, you can skip this step

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider"

Add the configuration to the config/settings file generated previously

'settings' => [
  ...
  Guysolamour\Hootsuite\Settings\HootsuiteSettings::class,
]

Add these keys to your .env file

/*
  Available in your hootsuite dashboard
*/
HOOTSUITE_CLIENT_ID=your_hootsuite_client_id
/*
  Available in your hootsuite dashboard
*/
HOOTSUITE_CLIENT_SECRET=your_hootsuite_client_secret

/*
  Only the url path
  A route will be create with this url path
  The redirect uri domain must be your website domain
*/
HOOTSUITE_REDIRECT_URI=your_hootsuite_redirect_uri

Publish package assets

php artisan vendor:publish --provider="Guysolamour\Hootsuite\ServiceProvider"

Run migrations

php artisan migrate

If you wanted to shorten the urls used in your posts. You should get an api key from bitly and add it to your .env file

Publish Laravel Bitly package config file

php artisan vendor:publish --provider="Shivella\Bitly\BitlyServiceProvider"

and add this in your .env file

BITLY_ACCESS_TOKEN=your_bitly_secret_access_token

Then pass this option (s) to true

'bitly_text_link' => true, // for the publication main link
'bity_all_links'  => true, // for all links in publication text

Usage

This package allows you to interact with the hootsuite API from a Laravel application. To do this, you must have a hootsuite account and allow the package to access this account.

You can get authorization link with this artisan command

php artisan hootsuite:oauth:url

Make a publication

use Guysolamour\Hootsuite\Facades\Hootsuite;

Hootsuite::publish([
  'text'        => "This is a text", // required
  'hashtags'    => ["this, is, a, hashtag"], // or "this|is|a|hashtag" or ['this', 'is', 'a', 'hashtag'] or "this,is,a,hashtag"
  'networks'    => "Facebook, Twitter, Linkedin", // required
  'media'       => 'https://domain.com/imagelink.jpg', // ['mediaUrl1', 'mediaUrl2']
  'link'        => 'https://link.com',
]);

Schedule a publication

use Guysolamour\Hootsuite\Facades\Hootsuite;

Hootsuite::schedule([
  'text'        => "This is a text", // required
 'hashtags'    => ["this, is, a, hashtag"], // or "this|is|a|hashtag" or ['this', 'is', 'a', 'hashtag'] or "this,is,a,hashtag"
  'networks'    => "Facebook, Twitter, Linkedin",
  'media'       => 'https://domain.com/imagelink.jpg', // ['mediaUrl1', 'mediaUrl2']
  'link'        => 'https://link.com',
  'schedule_at' => '2021-01-15 08:59:12' // or carbon instance | required when schedule
]);

Delete a scheduled post that is not yet published

use Guysolamour\Hootsuite\Facades\Hootsuite;


Hotsuite::destroy(int $messageId) :bool;

Retrieve information about your account

use Guysolamour\Hootsuite\Facades\Hootsuite;

Hootsuite::user();

Check if the post is pending

use Guysolamour\Hootsuite\Facades\Hootsuite;

Hootsuite::messageIsStillScheduled(int $messageId);

Get scheduled post

use Guysolamour\Hootsuite\Facades\Hootsuite;

Hootsuite::getMessage(int $messageId);

You can type the API directly with these different methods

use Guysolamour\Hootsuite\Facades\Hootsuite;

// Get
Hootsuite::get(string $url);
// Post
Hootsuite::post(string $url);
// Put
Hootsuite::put(string $url);
// Delete
Hootsuite::delete(string $url);

Security

If you discover any security related issues, please email rolandassale@gmail.com instead of using the issue tracker.

Credits

This package is bootstrapped with the help of melihovv/laravel-package-generator.

统计信息

  • 总下载量: 166
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固