开源软件名称(OpenSource Name):ncarlier/feedpushr开源软件地址(OpenSource Url):https://github.com/ncarlier/feedpushr开源编程语言(OpenSource Language):Go 75.4%开源软件介绍(OpenSource Introduction):feedpushrA simple feed aggregator service with sugar on top. Features
InstallationRun the following command: $ go get -v github.com/ncarlier/feedpushr/v3 Or download the binary regarding your architecture: $ curl -s https://raw.githubusercontent.com/ncarlier/feedpushr/master/install.sh | bash
$ # Or with https://gobinaries.com/
$ curl -sf https://gobinaries.com/ncarlier/feedpushr | sh Or use Docker: $ docker run -d --name=feedpushr ncarlier/feedpushr ConfigurationFeedpushr can be configured by using command line parameters or by setting environment variables. Type All configuration variables are described in etc/default/feedpushr.env file. TagsYou can define tags on feeds using the Web UI or the API: $ curl -XPOST http://localhost:8080/v2/feeds?url=http://www.hashicorp.com/feed.xml&tags=foo,bar Tags can also be imported/exported in OPML format. When using OMPL, tags are stored into the category attribute. OPML category is a string of comma-separated slash-delimited category strings.
For example, this OMPL attribute Once feeds are configured with tags, each new article will inherit these tags and be pushed out with them. OutputsNew articles are sent to outputs. Currently, there are some built-in output providers:
Outputs can be extended using plugins. Conditional expressionOutputs are activated according to a conditional expression. If the output has no condition it will be activated regardless of the input article. Otherwise the expression will be applied to the article and its result will decide whether the output is used or not. For example, if we want to use an output only on articles tagged news and mentioning Paris in their title.
We can use the following expression: The conditional expression language is documented here. Output formatFor some outputs ( If the format is not specified, the output will be formatted as the following JSON document: {
"title": "Article title",
"text": "Article text description",
"content": "Article HTML content",
"link": "Article URL",
"updated": "Article update date (String format)",
"updatedParsed": "Article update date (Date format)",
"published": "Article publication date (String format)",
"publishedParsed": "Article publication date (Date format)",
"guid": "Article feed GUID",
"feedTitle": "Feed title",
"meta": {
"key": "Metadata keys and values added by filters"
},
"tags": ["list", "of", "tags"]
} If, on the other hand, you specify a format, it must comply with the Golang template syntax. Basically, you have access to the JSON properties above but prefixed with a dot and a capital letter all surrounded by 2 brackets.
For example, the Let's say you want to send a JSON payload to a Mattermost Webhook. You can format the payload like this: {
"text": ":tada: {{.Title}} (<{{.Link}}|more>) cc @all",
} You can use template functions with some additions:
FiltersBefore being sent, articles can be modified through a filter chain. Currently, there are some built-in filter:
Filters can be extended using plugins. Like outputs, filters are activated according to a conditional expression. Filters are attached to an output, so they inherit the conditional expression of the output. PluginsYou can easily extend the application by adding plugins. A plugin is a compiled library file that must be loaded when the application starts. Plugins inside Example: $ feedpushr --plugin ./feedpushr-twitter.so You can find some external plugins (such as for Twitter) into this directory. LauncherFeedpushr can be started in "desktop mode" thanks to a launcher.
The purpose of User InterfaceYou can access Web UI on http://localhost:8080/ui AuthenticationYou can restrict access to Feedpushr using HTTP basic authentication or OpenID Connect. Basic authenticationTo activate basic authentication, you have to create a $ # create passwd file the user 'admin'
$ htpasswd -B -c .htpasswd admin This command will ask for a password and store it in the htpawsswd file. Please note that by default, Feedpushr will try to load the But you can override this behavior by specifying the location of the file: $ export FP_AUTHN=/etc/feedpushr.htpasswd
$ # or
$ feedpushr --authn /etc/webhookd/users.htpasswd OpenID ConnectTo activate OIDC authentication, you have to specify OIDC issuer URL: $ export FP_AUTHN=https://accounts.google.com
$ # or
$ feedpushr --authn https://accounts.google.com Note that you can restrict access for a specific username like this: $ export FP_AUTHORIZED_USERNAME=xxx
$ # or
$ feedpushr --authorized-username xxx Use casesStart the service$ # Start service with default configuration:
$ feedpushr
$ # Start service with custom configuration:
$ export FP_DB="boltdb:///var/opt/feedpushr.db"
$ export FP_DELAY=20s
$ export FP_LOG_LEVEL=warn
$ feedpushr Add feeds$ # Add feed with the CLI
$ feedpushr-ctl create feed --url http://www.hashicorp.com/feed.xml
$ # Add feed with cURL
$ curl -XPOST http://localhost:8080/v2/feeds?url=http://www.hashicorp.com/feed.xml
$ # Import feeds from an OPML file
$ curl -XPOST http://localhost:8080/v2/opml -F"file=@subscriptions.opml" Manage feeds$ # List feeds
$ feedpushr-ctl list feed
$ # Get a feed
$ feedpushr-ctl get feed --id=9090dfac0ccede1cfcee186826d0cc0d
$ # Remove a feed
$ feedpushr-ctl delete feed --id=9090dfac0ccede1cfcee186826d0cc0d
$ # Stop aggregation of a feed
$ feedpushr-ctl stop feed --id=9090dfac0ccede1cfcee186826d0cc0d
$ # Start aggregation of a feed
$ feedpushr-ctl start feed --id=9090dfac0ccede1cfcee186826d0cc0d Misc$ # Get OpenAPI JSON
$ curl http://localhost:8080/swagger.json
$ # Get runtime vars
$ curl http://localhost:8080/v2/vars
$ # Here a quick ETL shell pipeline:
$ # Send transformed articles to HTTP endpoint using shell tools (jq and httpie)
$ feedpushr \
| jq -c "select(.title) | {title:.title, content:.description, origin: .link}" \
| while read next; do echo "$next" | http http://postb.in/b/i1J32KdO; done For developmentTo be able to build the project you will need to:
Then you can build the project using make: $ make Type LicenseGNU General Public License v3.0 See LICENSE to see the full text. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论