定制 toin0u/yo 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

toin0u/yo

最新稳定版本:1.0.2

Composer 安装命令:

composer require toin0u/yo

包简介

Just Yo API wrapper

README 文档

README

Just Yo API wrapper for fun :)

Build Status Latest Stable Version Scrutinizer Code Quality Total Downloads License

Installation

This library can be found on Packagist. The recommended way to install this is through composer.

Run these commands to install composer, the library and its dependencies:

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar require toin0u/yo:@stable

Or edit composer.json and add:

{
    "require": {
        "toin0u/yo": "@stable"
    }
}

Protip: you should browse the toin0u/yo page to choose a stable version to use, avoid the @stable meta constraint.

API

This package uses the awesome Ivory Http Adapter which supports plenty adapters. We will use the CurlHttpAdapter for our examples.

Following methods throw a \RuntimeException if something goes wrong during the API calls.

<?php

require 'vendor/autoload.php';

use Ivory\HttpAdapter\CurlHttpAdapter;
use Yo\Yo;

$yo = new Yo(new CurlHttpAdapter, 'you_api_token');

// ...

You can find your API token in your Yo dashboard.

Following API examples will use the Yo instance created previously:

/yo/

// ...

$yo->user('foobar'); // Yo FOOBAR
$yo->user('foobar', new \Yo\Bag\Link('http://sbin.dk/')); // Yo FOOBAR with a link
$yo->user('foobar', new \Yo\Bag\Location(55.699953, 12.552736)); // Yo FOOBAR with a location

This method returns true on success false otherwise.

Read more

/yoall/

// ...

$yo->all(); // Yo your subscribers
$yo->all(new \Yo\Bag\Link('http://sbin.dk/')); // Yo your subscribers with a link

This method returns nothing. Please note The API allows only one Yo once per minute.

Read more

/accounts/

// ...

$yo->create('barbaz', 'newpassword');

Please note that you can provide a callback url, an email, a description and a boolean to tell if the account requires location or not.

Read more

/check_username/

// ...

$yo->exists('foobar'); // checks if FOOBAR exsists or not.

This method returns true on success false otherwise.

Read more

/subscribers_count/

// ...

echo $yo->total(); // get total number of subscribers

Read more

Specification tests

Install PHPSpec globally with composer and run it in the project.

$ composer global require phpspec/phpspec:@stable
$ phpspec run -fpretty

Contributing

Please see CONTRIBUTING for details.

Support

Please open an issues in github

Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant, version 1.0.0, available at http://contributor-covenant.org/version/1/0/0/

License

This Yo package is released under the MIT License. See the bundled LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固