1
0
mirror of https://github.com/oceanprotocol/webtasks synced 2024-06-30 05:32:04 +02:00
webtasks/README.md

111 lines
3.2 KiB
Markdown
Raw Normal View History

2018-03-20 18:12:48 +01:00
# Webtasks
2018-03-21 13:16:55 +01:00
> 🐬 Ocean Protocol's webtasks doing automatic things for us via webtask.io
2018-03-20 18:34:32 +01:00
![giphy](https://user-images.githubusercontent.com/90316/37671913-0eb2f70a-2c6d-11e8-809e-04d3b40ef1c9.gif)
2018-03-20 18:12:48 +01:00
[![Build Status](https://travis-ci.com/oceanprotocol/webtasks.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/webtasks)
[![js ascribe](https://img.shields.io/badge/js-ascribe-39BA91.svg)](https://github.com/ascribe/javascript)
## Tasks
### Medium
2018-03-20 18:34:32 +01:00
**`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:
2018-03-21 12:43:05 +01:00
```
2018-03-21 13:16:55 +01:00
http://localhost:8080/MEDIUM_USERNAME
2018-03-20 18:34:32 +01:00
```
When published as a web task, append the taskname followed by the Medium username at the end:
2018-03-21 12:43:05 +01:00
```
https://TASK_URL/TASK_NAME/MEDIUM_USERNAME
```
### YouTube
2018-03-21 12:43:05 +01:00
2018-04-05 11:36:56 +02:00
**`webtask-youtube.js`**: Generic task to fetch and reconstruct items from any YouTube account. For now, only fetches a playlist. YouTube API key is provided via [secret environment variable](https://webtask.io/docs/issue_parameters) `YOUTUBE_API_KEY` setup in web editor of webtask.io
2018-03-21 12:43:05 +01:00
Construct your request url like so, e.g. locally:
```
2018-04-05 11:36:56 +02:00
http://localhost:8080/YOUTUBE_PLAYLIST_ID
2018-03-21 12:43:05 +01:00
```
Add the task name when published on webtask.io:
```
2018-04-05 11:36:56 +02:00
https://TASK_URL/TASK_NAME/YOUTUBE_PLAYLIST_ID
2018-03-20 18:34:32 +01:00
```
2018-03-20 18:12:48 +01:00
### Zoho
**`webtask-zoho.js`**: Generic task to subscribe users into lists on Zoho Campaigns & Zoho CRM. Credentials are provided via [secret environment variables](https://webtask.io/docs/issue_parameters), setup in web editor of webtask.io.
The user input data needs to be in `json` format like so:
```
{Contact Email:info@oceanprotocol.com}
```
To subscribe a user to the newsletter, construct your request url like so, e.g. locally:
```
http://localhost:8080/newsletter/DATA
```
Add the task name when published on webtask.io:
```
https://TASK_URL/TASK_NAME/newsletter/DATA
```
2018-03-20 18:12:48 +01:00
## Development
```bash
2018-03-21 12:43:05 +01:00
npm install wt-cli -g
2018-03-20 18:12:48 +01:00
npm start
```
2018-03-21 13:16:55 +01:00
And go to [localhost:8080](http://localhost:8080)
2018-03-20 18:12:48 +01:00
## Deployment
2018-03-20 18:34:32 +01:00
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`:
```bash
npm install wt-cli -g
wt init YOUR_GITHUB_EMAIL
2018-03-20 18:12:48 +01:00
2018-03-20 18:34:32 +01:00
wt create webtask-medium.js --name medium
# make sure it's there and get url
wt ls
```
2018-03-20 18:12:48 +01:00
2018-03-21 12:43:05 +01:00
## Authors
- Matthias Kretschmann ([@kremalicious](https://github.com/kremalicious)) - [BigchainDB](https://www.bigchaindb.com) & [Ocean Protocol](https://oceanprotocol.com)
2018-03-21 13:16:55 +01:00
- initial Medium web task by Pedro Gomes ([@pedrouid](https://github.com/pedrouid)) - [Balance](https://balance.io)
2018-03-21 12:43:05 +01:00
2018-03-20 18:12:48 +01:00
## 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.
```