GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Puniko ? (puniko@mk.absturztau.be)'s status on Monday, 05-Dec-2022 21:25:12 JST Puniko ? Puniko ?
    in reply to
    • Volpeon :drgn_fire:​:drgn_scream:

    @volpeon@mk.vulpes.one :akko_woozy: this seems more like a tiny little AP server than a bot, but ok

    In conversation Monday, 05-Dec-2022 21:25:12 JST from mk.absturztau.be permalink
    • Embed this notice
      Volpeon :drgn_fire:​:drgn_scream: (volpeon@mk.vulpes.one)'s status on Monday, 05-Dec-2022 21:25:13 JST Volpeon :drgn_fire:​:drgn_scream: Volpeon :drgn_fire:​:drgn_scream:

      It does seem to know about ActivityPub :drgn_think_cool:
      const express = require('express'); const bodyParser = require('body-parser'); const { fromObject, toObject, Actor, Collection, Link, OrderedCollection, OrderedCollectionPage, getId, getType } = require('activitypub'); const app = express(); app.use(bodyParser.json()); const actor = new Actor({ id: 'http://localhost:3000/actor', type: 'Person', name: 'Bot', inbox: 'http://localhost:3000/inbox', outbox: 'http://localhost:3000/outbox' }); app.post('/inbox', (req, res) => { const { body } = req; const object = fromObject(body); const objectType = getType(object); if (objectType === 'Create') { // handle creation of an object } else if (objectType === 'Follow') { // handle follow request } else if (objectType === 'Like') { // handle like request } res.send('OK'); }); app.get('/outbox', (req, res) => { const collection = new OrderedCollection({ id: 'http://localhost:3000/outbox', totalItems: 10, first: new OrderedCollectionPage({ id: 'http://localhost:3000/outbox?page=1', type: 'OrderedCollectionPage', partOf: 'http://localhost:3000/outbox', items: [ // array of objects that have been created by the bot ] }) }); res.json(toObject(collection)); }); app.listen(3000);

      In conversation Monday, 05-Dec-2022 21:25:13 JST permalink

      Attachments





Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.