pixelbrackets/has_yet 问题修复 & 功能扩展

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

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

pixelbrackets/has_yet

Composer 安装命令:

composer require pixelbrackets/has_yet

包简介

Has … yet? Script to set up a Twitter bot tweeting answers to important questions like “Has something happend yet?”

README 文档

README

Packagist Twitter

Has something happend yet? This is a small script to set up one of those Twitter bot accounts which automatically tweet answers to important questions like:

  • Has invisibility been invented yet?
  • Has [sports team] won/lose yet?
  • Has [shady polititian] resigned yet?
  • Has the world ended yet?

Example twitter bot using this repository:

Requirements

  • Twitter API Key
  • PHP
  • Composer
  • Cronjob

Usage

The PHP script should be executed with a cronjob. It then reads a JSON file consisting of default messages and messages for special dates. One message is selected and then pushed to a given Twitter account.

It is possible set up multiple accounts.

Installation

Set up the script

  1. Use composer to install the script and all dependencies
    • composer create-project pixelbrackets/has_yet
  2. Copy the configuration example file and rename it to configuration.json
    • The example configuration should be self-explaining, you may define custom messages for special days and/or one or more default messages
    • A status message may consist of a text and an image
    • The optional image may be a local filename or a URL (http/https supported)
  3. Protect the whole folder from public access (eg. with a htaccess file or move the directory outside of the document root)!

Set up a Twitter account

  1. Register a Twitter account (that was obvious, wasn't it?)
  2. Register an app for this account
    • The advantage of this move is that you won't need to set up an OAuth Login, since Twitter offers to generate an Access Token for the own account
  3. Go to https://apps.twitter.com/ to create/register the Twitter App
  4. Click “Create New App” Button
  5. Create an application (Name, Description, Website etc.)
  6. Change “Permissions” to “Read & Write”
  7. Generate an Access Token on the “Keys and Access Tokens” tab
  8. Copy API Key, API Secret, Access Token, Access Token Secret into the configuration file

Set up a cronjob

  1. Set up a cronjob which points to the cron.php file
    • eg. 0 10 * * * php /path/to/cron.php
    • You may choose any interval, but be aware that Twitter has a mechanism to detect duplicate tweets (https://twittercommunity.com/t/duplicate-tweets/13264). Consider this if you want to frequently post the same status message. It appears that a 24 hour time range is sufficient.
  2. If you want to set up multiple accounts or use varying messages, then rename the JSON configuration file and pass the filename as argument
    • eg. johndoe.json and php /path/to/cron.php johndoe

Source

https://github.com/pixelbrackets/has_yet/

Documentation

Read online (HTML) https://github.com/pixelbrackets/has_yet/blob/master/README.md

License

GNU General Public License version 2 or later

The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.

Author

Dan Untenzu (mail@pixelbrackets.de / @pixelbrackets)

Changelog

See ./CHANGELOG.md

Contribution

This script is Open Source, so please use, patch, extend or fork it.

pixelbrackets/has_yet 适用场景与选型建议

pixelbrackets/has_yet 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 398 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 12 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 pixelbrackets/has_yet 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 pixelbrackets/has_yet 我们能提供哪些服务?
定制开发 / 二次开发

基于 pixelbrackets/has_yet 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2014-12-10