Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximbilan/jobsfinder
A script which parses Upwork RSS feed and sends notifications to Telegram
https://github.com/maximbilan/jobsfinder
rss rss-feed rss-reader telegram telegram-bot telegram-bot-api upwork upwork-api
Last synced: 3 months ago
JSON representation
A script which parses Upwork RSS feed and sends notifications to Telegram
- Host: GitHub
- URL: https://github.com/maximbilan/jobsfinder
- Owner: maximbilan
- License: mit
- Created: 2019-01-05T09:03:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T18:37:18.000Z (over 1 year ago)
- Last Synced: 2024-04-20T11:04:16.884Z (9 months ago)
- Topics: rss, rss-feed, rss-reader, telegram, telegram-bot, telegram-bot-api, upwork, upwork-api
- Language: JavaScript
- Size: 20.5 KB
- Stars: 17
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JobsFinder
A script which parses Upwork RSS feed and sends notifications to Telegram.```js
const credentials = require('./credentials.json')const FeedSub = require('feedsub')
const rssFeed = credentials.rss_feed
let reader = new FeedSub(rssFeed, {
interval: 1 // Check feed every 1 minute.
})const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('db.json')
const db = low(adapter)db.defaults({ feed: [] }).write()
const Telegraf = require('telegraf')
const Extra = require('telegraf/extra')
const session = require('telegraf/session')
const token = credentials.telegram_bot_token
const bot = new Telegraf(token)// Register session middleware.
bot.use(session())// Register logger middleware.
bot.use((ctx, next) => {
const start = new Date()
return next().then(() => {
const ms = new Date() - start
console.log('response time %sms', ms)
})
})reader.on('item', (item) => {
console.log(item.title)const itemInDb = db.get('feed').find({ link: item.link }).value()
if (itemInDb) {
console.log("This item is already exists:")
console.log(itemInDb.link)
} else {
db.get('feed').push(item).write()
var message = item.description
bot.telegram.sendMessage(credentials.telegram_channel, message, Extra.HTML().markup())
}
})reader.start()
```
More information here.