1
0
mirror of https://github.com/oceanprotocol/webtasks synced 2024-06-23 01:36:44 +02:00
🐬🦄 Webtasks doing automatic things for us via webtask.io
Go to file
2018-03-21 12:42:31 +01:00
.editorconfig drop da base ☃️ 2018-03-20 18:12:48 +01:00
.eslintrc rewrite all the things 2018-03-20 18:34:32 +01:00
.gitignore drop da base ☃️ 2018-03-20 18:12:48 +01:00
.travis.yml rewrite all the things 2018-03-20 18:34:32 +01:00
LICENSE drop da base ☃️ 2018-03-20 18:12:48 +01:00
package.json use wt serve for local development 2018-03-21 12:42:31 +01:00
README.md rewrite all the things 2018-03-20 18:34:32 +01:00
webtask-medium.js use wt serve for local development 2018-03-21 12:42:31 +01:00

Webtasks

Ocean Protocol's webtasks doing automatic things for us via webtask.io

giphy

Build Status js ascribe

Tasks

webtask-medium.js: Generic task to fetch and reconstruct items from any medium publication.

Requires the Medium username appended at the end of the url, e.g. locally:

fetch('http://localhost:4000/oceanprotocol')
    .then(res => res.json())
    .then(posts => {
        const lastPosts = posts.slice(0, 3)
    })

When published as a web task, append the taskname followed by the Medium username at the end:

fetch('https://wt-bfc3ae9804422f8a4ea114dc7c403296-0.run.webtask.io/medium/oceanprotocol')
    .then(res => res.json())
    .then(posts => {
        const lastPosts = posts.slice(0, 3)
    })

Development

npm start

Deployment

All tasks are running serverless on webtask.io where you can login with your GitHub account. Then interact with it locally with the wt-cli:

npm install wt-cli -g
wt init YOUR_GITHUB_EMAIL

wt create webtask-medium.js --name medium

# make sure it's there and get url
wt ls

License

Copyright 2018 Ocean Protocol Foundation Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.