Giter VIP home page Giter VIP logo

feed2nostr's Introduction

feed2nostr

Post event via RSS feed.

Usage

feed2nostr -dsn $DATABASE_URL \
    -feed https://www.reddit.com/r/golang.rss \
    -format '{{.Title}}{{"\n"}}{{.Link}} #golang_news'

Or kubernetes cronjob.

apiVersion: batch/v1
kind: CronJob
metadata:
  name: golang_news-bot
spec:
  schedule: '0 * * * *'
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      backoffLimit: 1
      template:
        spec:
          containers:
          - name: golang_news-bot
            image: mattn/feed2nostr
            imagePullPolicy: IfNotPresent
            #imagePullPolicy: Always
            command: ["/go/bin/feed2nostr"]
            args:
            - '-feed'
            - 'https://www.reddit.com/r/golang.rss'
            - '-format'
            - '{{.Title}}{{\"\n\"}}{{.Link}} #vimeditor'
            env:
            - name: FEED2NOSTR_NSEC
              valueFrom:
                configMapKeyRef:
                  name: nsec1xxxxxx
                  key: feed2nostr-nsec
            - name: FEED2NOSTR_RELAYS
              valueFrom:
                configMapKeyRef:
                  name: golang_news-bot
                  key: feed2nostr-relays
            - name: FEED2NOSTR_DSN
              valueFrom:
                configMapKeyRef:
                  name: golang_news-bot
                  key: feed2nostr-dsn
          restartPolicy: Never
apiVersion: v1
kind: ConfigMap
metadata:
  name: golang-news-bot
data:
  feed2nostr-nsec: 'XXXXXXXXXXXXXXXXXXXXXX'
  feed2nostr-relays: 'wss://server1:7447,wss://server2:8080'
  feed2nostr-dsn: 'postgres://user:password@server/database'

Installation

$ go install github.com/mattn/feed2nostr@latest

Or use mattn/feed2nostr for docker image.

License

MIT

Author

Yasuihro Matsumoto (a.k.a. mattn)

feed2nostr's People

Contributors

mattn avatar atrifat avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.