Skip to content

Instantly share code, notes, and snippets.

@metacoin
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metacoin/8eec7abe1c504cc8c03b to your computer and use it in GitHub Desktop.
Save metacoin/8eec7abe1c504cc8c03b to your computer and use it in GitHub Desktop.

Alexandria JSON format (twitter plugin)

Alexandria version: 1.0

Twitter Plugin version: 1.0

Introduction

Alexandria version 1.0 archives tweets in the Florincoin blockchain using the protocol defined here. This protocol allows other Alexandria nodes as well as block explorers to identify Alexandria data within the blockchain. The following is a description of how data should be structured by a Librarian running the Alexandria client before it is put into the Florincoin blockchain.

Twitter

The first plugin for Alexandria will be a Twitter archive network. Archived tweets should be in the blockchain using the following format:

Alexandria:
{
    "v": "1.0",
    "p": {
        "twitter": {
            "v": "1.0",
            "data": [
                "<Search Term>",
                "<Librarian ID>",
                "<Archive ID>",
                "<Tweet Unique ID>",
                "<Timestamp>",
                <Unix Time>,
                <Geolocation>,
                <Number of Favorites>,
                <Number of Retweets>,
                <User Unique ID>,
                "<User Screen Name>",
                "<Tweet Plain Text>"
            ]
        }
    }
}

The first word directly followed by a colon Alexandria: represents the Florincoin specifier for a new protocol on the network. There exist specifiers for other applications already in the blockchain, such as t1:ALOVE>, used in the Aterna Love blockchain application. The specifier for a normal text message sent by a Florincoin qt-client is simply text:.

After the Alexandria protocol specifier there is a JSON formatted string of text that contains the Alexandria version number, plugin name, and data. For all Alexandria 1.0 tx-comments we will store the following data:

  • Version Number
  • Plugin

For the twitter plugin, we are storing the following data:

  • Version Number

Each archived tweet also includes a data array, which has the following values listed respectively:

  • Search Term (string): The original search used to grab this tweet from the twitter API.
  • Librarian ID (int): The identifier of this Librarian (username / Florincoin Address).
  • Archive ID (string): An Archive ID is a base58 encoded SHA256 hash of the following concatinated string: Librarian ID + Search Term + archive origination timestamp.
  • Tweet Unique ID (string): The unique identifier for the tweet. Returned as a string because javascript cannot parse int64 correctly as a number.
  • Timestamp (string): Time in RFC2822 format that the tweet was posted to twitter (according to the twitter API).
  • Unix Time (int): Time in Unix epoc format that the tweet was posted to twitter (according to the twitter API).
  • Geolocation (int): Geolocation coordinates of this tweet.
  • Number of Favorites (int): The number of favorites this tweet has at time of archiving.
  • Number of Retweets (int): The number of retweets this tweet has at time of archiving.
  • User Unique ID (int): The unique ID of the twitter handle that sent the tweet.
  • User Screen Name (string): The screen name of the twitter handle that sent the tweet.
  • Tweet Plain Text (string): Finally, the tweet itself is stored in the blockchain.

In later versions, more data can be added, such as relevant information about the tweet at the time of its creation. Later versions will have a new JSON format, and should have a version number strictly greater than the previous version to preserve backwards compatibility.

Planned Features

  • Display original retweeter Screen Name/User Unique ID

License

GPL

Author

Joseph Fiscella

joseph@blocktech.com

Hooray, Free Software!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment