定制 sleiman/addcontext-php 二次开发

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

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

sleiman/addcontext-php

Composer 安装命令:

composer require sleiman/addcontext-php

包简介

PHP wrapper to connect with AddContext.io API and save context snapshots based on events/actions

README 文档

README

A PHP wrapper for the AddContext API. Feedback or bug reports are appreciated.

Get started

Installation

If you're using Composer, you can run the following command:

composer require sleiman/addcontext-php

You can also download them directly and extract them to your web directory.

Add the wrapper to your project

If you're using Composer, run the autoloader

require 'vendor/autoload.php';

Or include the Addcontext.php file

include('../src/Addcontext.php');

Initialize the class

use \TANIOS\Addcontext\Addcontext;
$addcontext = new Addcontext(array(
    'access_token' => 'ACCESS_TOKEN',
));

Create new snapshot request

We want to create a new entry in the system via the API

// Add any metadata you want to associate to that snapshopt to an array

$metadata['text_main_entity']   = 'russia';
$metadata['sent_from']   = 'iphone';
$metadata['tweet_id'] = '123213213';
$metadata['tweet_content']    = 'messsage text';

// Add all the information you have to an array (email, datetime and rule are mandatory)
// Add the metada array to the fields array

$fields = array(
    'email' => "someletters@youcanread.com",
    'datetime'=> "2018-03-01 19:08:00",
    'rule' => 'trump tweeted',
    'metadata'=> $metadata
);

// Create the snapshot 
$new_snapshot = $addcontext->createSnapshotRequest($fields);

Credits

Copyright (c) 2018 - Programmed by Sleiman Tanios

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固