Build Scramjet with Us!We're hiring

Samples 📚

We have prepared some samples for you that show the different uses of a Sequence. Some are super simple, some are a little more advanced. They show the use of data from various resources, such as local disk, external API, or plain keyboard input. The samples are differentiated according to language in which they were written. Every sample contains a short readme with a guidance describing the procedure for running the example as well as is linked to its source code on GitHub. Please take a look at our samples and if you have any questions or difficulties, feel free to ask us on Discord.

The execution will be performed from the command line using our CLI, which full description and documentation you will find in CLI Reference.

In samples we are using methods and definitions described in APP Reference.

Prerequisites

Sample execution requires prior environment preparation and installations.

Environment

You can run each sample either on your Self Hosted Hub or Scramjet Cloud Platform. Choose the most suitable for you and follow the link that provides installation tips and guidelines:

Command Line Interface

Samples execution will be performed from the command line using our CLI, which full description you will find in our official documentation website in CLI Reference section, or run si --help command where you have everything in a nutshell.

You can install the si command from npm using the following command:

npm i -g @scramjet/cli

Repository

Please clone our GitHub platform-samples repository:

git clone https://github.com/scramjetorg/platform-samples.git

javascript samples

hello

Sequence that modifies incoming stream of strings by adding Hello.

json-url-output

Sequence that pulls data from JSON url every x seconds and writes it to Instance output endpoint.

json-url-stdout

Sequence that pulls data from JSON url every x seconds and writes it to Instance stdout endpoint.

pokemon

A Sequence that reads incoming data via input stream, then based on that data, a request is sent to external API.

simple-counter-js

A simple Sequence, that counts and logs the number in 1s intervals.

test-output

Sequence that writes random values to output stream.

python samples

gh-issues-to-clickup

Sequence that sends GitHub issues to dedicated ClickUp list.

python-kafka-consumer

Sequence that can retrieve data from Kafka topic and show the result on 'output'.

python-kafka-transformer

Sequence that can send data to Kafka topic from input.

python-markdown-keywords

Sequence that suggests keywords for header in *.md. This is also an easy example of usage Kaffka with Scramjet platform.

rpilocator-scraper

rpilocator.com in-stock watcher.

telegram-write

Forwards input to a specified telegram channel.

python-voice-recognition

This Sequence is a trivial example of voice recognition with Scramjet and speech_recognition Python library.

typescript samples

crypto-prices

Sequence that keeps printing current crypto prices for a provided pair of currencies every 1s.

discord-read

Sequence that reads messages from Discord channel and writes to topic.

discord-write

Sequence that reads messages from topic and writes to Discord via webhook.

hexdump

A simple Sequence that takes file as an input and returns a hexadecimal view of this file on output.

linkedin

This sequence processes CSV input and retrieves additional company data from LinkedIn via RapidAPI

mediawiki

Sequence that keeps printing mediawiki event stream.

read-targz-stats

Sequence that reads tar.gz file from input and returns JSON containing basic information about archived files along with unpacked data.

rss

A Sequence that works as a web feed, monitors website for a new content.

scraping

This is a simple and trivial example of scraping web pages.

send-to-github

A Sequence that commits a JSON object to a file on Github

slack-read

Sequence that reads messages from Slack and writes to topic.

slack-write

Sequence that reads messages from topic and writes to Slack.

stack-overflow

This a Sequence that gets the number of changes in Stack Overflow tag count. This queries SO API every x minutes, gathers, compares and outputs result as difference.

transform-string-stream

Sequence that modifies incoming stream of strings by adding a prefix and a suffix.

write-to-database

Sequence that writes data to SQL database

Was it helpful?

Didn't find information needed?

Join our Discord community, where you can get help from our engineers directly.

JOIN DISCORD