GithubHelp home page GithubHelp logo

pwfoo / php-activitystreams Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dansup/php-activitystreams

0.0 3.0 0.0 27 KB

Activity Streams is a simple specification used to describe social actions around the web.

Home Page: https://www.w3.org/TR/activitystreams-core

License: MIT License

PHP 100.00%

php-activitystreams's Introduction

php-activitystreams

A PHP implementation of the Activity Streams 2.0 specification

Software License Latest Version on Packagist Total Downloads

This package is in active development, this is not a complete implementation of ActivityStreams 2.0

A modern AS2 php library. At the moment, only the object model type is partially implemented. I look forward to getting this feature complete by the end of summer 2017.

Install

Via Composer

$ composer require dansup/php-activitystreams

Usage

Lets create a basic object model and echo the response to a json encoded string.

use Dansup\ActivityStreams\ServerFactory;

$item = ServerFactory::create('object');

$item->type('Note')
$item->id('http://example.org/note/123');
$item->name('Our Weather Is Fine');
$item->content('I feel that the weather is appropriate to our season and location.');
$item->attributedTo([
  'id' => 'http://joe.website.example/',
  'type' => 'Person',
  'name' => 'Joe Smith'
]);
$item->addField('url', 'http://example.org/permalink/123');

echo $item->get();

Result:

{
 "@context": "https:\/\/www.w3.org\/ns\/activitystreams",
 "type": "Note",
 "id": "http:\/\/example.org\/note\/123",
 "name": "Our Weather Is Fine",
 "attributedTo": {
     "id": "http:\/\/joe.website.example\/",
     "type": "Person",
     "name": "Joe Smith"
 },
 "content": "I feel that the weather is appropriate to our season and location.",
 "published": "2017-04-21T01:31:20+00:00",
 "url": "http:\/\/example.org\/permalink\/123"
}

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

php-activitystreams's People

Contributors

dansup avatar

Watchers

 avatar  avatar  avatar

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.