sup.php

Summary
sup.php
SUPA SUP action to produce correct SUP json output
SupActionAction class to update a stream based on a given interval
handleGet updates for the stream based on the update period specified.
availablePeriodsDetermines which of the various HARDCODED arbitrary periods our interval is closest to and returns that.
getUpdatesFetches and returns new notices for a stream since the last update
isReadOnlyReturns whether the action class is read only (yes)

SUP

A SUP action to produce correct SUP json output

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

A SUP action to produce correct SUP json output

PHP version

Tested with PHP 7.0

File Authors

Web

SupAction

Action class to update a stream based on a given interval

Summary
handleGet updates for the stream based on the update period specified.
availablePeriodsDetermines which of the various HARDCODED arbitrary periods our interval is closest to and returns that.
getUpdatesFetches and returns new notices for a stream since the last update
isReadOnlyReturns whether the action class is read only (yes)

handle

function handle()

Get updates for the stream based on the update period specified.  Prints a json encoded string with them.

Parameters

  • none

Returns

  • void

availablePeriods

function availablePeriods()

Determines which of the various HARDCODED arbitrary periods our interval is closest to and returns that.

Parameters

  • none

Returns

  • $array - periods we can use based on the given desired interval

getUpdates

function getUpdates($seconds)

Fetches and returns new notices for a stream since the last update

Parameters

  • seconds - update interval

Returns

  • array %updates - new array of ids of the new notices

isReadOnly

function isReadOnly($args)

Returns whether the action class is read only (yes)

Parameters

  • array $args - ignored

Returns

  • boolean true
function handle()
Get updates for the stream based on the update period specified.
function availablePeriods()
Determines which of the various HARDCODED arbitrary periods our interval is closest to and returns that.
function getUpdates($seconds)
Fetches and returns new notices for a stream since the last update
function isReadOnly($args)
Returns whether the action class is read only (yes)