Skip to content

Commit

Permalink
Add docs/ and tweak copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dewey committed Aug 23, 2018
1 parent 6c4e723 commit fa14618
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 11 deletions.
10 changes: 10 additions & 0 deletions docs/Docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run with Docker

There's an official Feedbridge image located on https://hub.docker.com/r/tehwey/feedbridge/. To
run the latest version just make use of the included `docker-compose` file.

```
docker-compose -f docker-compose.yml up -d
```

After that it'll run on Port 8080 and listening on localhost.
4 changes: 4 additions & 0 deletions docs/Metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Prometheus Metrics

Feedbridge per default exposes a Prometheus Metrics endpoint on `/metrics`. You
can use Prometheus, Grafana and the included Grafana dashboard to monitor your instance.
37 changes: 37 additions & 0 deletions docs/Plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Adding a new plugin

The best starting point to get into plugin development is to look at the existing plugins
located in `plugins/`. The main idea is that a plugin gets a *http.Client to do requests
and returns a *feeds.Feed object that will then be stored by the system.

Every plugin has to implement this interface:

```
type Plugin interface {
Run() (*feeds.Feed, error)
Info() PluginMetadata
}
```

What you do within `Run()` is pretty flexible. You either talk to an API, Marshall JSON or you
do webscraping with `goquery`. For that usecase there are already some convinience wrappers
available, located in the `scrape` package. If sensible feel free to add new helper functions
there if they are re-usable.

# Installing the plugin

To install a plugin it has to be added to the global plugin repository, once this is done the
plugin will run periodically as defined by the interval that is set for the instance.

```
pluginRepo.Install(scmp.NewPlugin(l, c))
```

# Open a Pull Request

If you think your plugin could be useful to more people please open a Pull Request on Github:

https://github.com/dewey/feedbridge/pulls

I'll review, merge and release a new version so other people can use it on the hosted version.

9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ func main() {
http.Error(w, errors.New("couldn't serve template").Error(), http.StatusInternalServerError)
return
}
if err := t.Execute(w, apiService.ListFeeds()); err != nil {
data := struct {
Feeds []plugin.PluginMetadata
RefreshInterval int
}{
Feeds: apiService.ListFeeds(),
RefreshInterval: config.RefreshInterval,
}
if err := t.Execute(w, data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
Expand Down
49 changes: 39 additions & 10 deletions ui/templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/tachyons.min.css" />
<link rel="stylesheet" href="/static/styles.css" />
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="manifest" href="/static/site.webmanifest">
<meta name="apple-mobile-web-app-title" content="Feedbridge">
<meta name="application-name" content="Feedbridge">
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="theme-color" content="#ffffff">

<body class="w-100 bg-green white avenir">
<section class="mw5 mw7-ns center">
Expand All @@ -21,15 +29,11 @@
<article class="lh-copy">
<p>Feedbridge is a tool that generates RSS / Atom or JSON feeds for websites that don't have one or only offer
one without the full content. Feedbridge is plugin-based, so for a website to be available here a plugin
to scrape the source needs to be built and deployed. It's built by
<a href="https://twitter.com/tehwey" class="link dim white underline">me</a> mostly for myself but I'm happy to build more plugins or merge yours.</p>
<p>Everyone can contribute by creating a plugin (Written in Go) and opening a Pull Request on
<a href="https://github.com/dewey/feedbridge" class="link dim white underline">Github</a>.</p>
to scrape the source needs to be built.
</article>
</section>
<section class="mw7 center">
{{ $feed := . }}
{{ range . }}
{{ $feed := .Feeds }} {{ range .Feeds }}
<h2 class="f3 ph3 ph0-l">Available Feeds ({{ len $feed }})</h2>
<article class="bt bb" v-for="plugin in plugins">
<div class="flex flex-column flex-row-ns db pv4 ph3 ph0-l">
Expand Down Expand Up @@ -63,9 +67,20 @@
</article>
{{end}}
</section>
<section class="mw7 center">
<h2 class="f3 ph3 ph0-l lh-copy" id="about">About</h2>
All active feeds are refreshed every 15 minutes. Just copy the URL in preferred format and add it to your feed reader.
<section class="mw7 center lh-copy">
<h2 class="f3 ph3 ph0-l" id="contribute">Missing a feed?</h2>
<p>Everyone can contribute by creating a plugin (Written in Go). Please open a
<a href="https://github.com/dewey/feedbridge/issues/new" class="link dim white underline">new issue</a> on the issue tracker and I'll see what I can do. If you want to contribute a plugin yourself
please read the
<a href="https://github.com/dewey/feedbridge/blob/master/docs/Plugin.md" class="link dim white underline">documentation</a>.
</section>
<section class="mw7 center lh-copy">
<h2 class="f3 ph3 ph0-l" id="about">About</h2>
All active feeds are refreshed every {{ .RefreshInterval }} minutes. Just click on your preferred format and add it to your
feed reader. Feedbridge is built by
<a href="https://twitter.com/tehwey" class="link dim white underline">me</a> mostly for myself after trying to
<a href="https://blog.notmyhostna.me/sad-state-of-rss-on-the-mac/" class="link dim white underline">move most of my reading to RSS</a>. Feel free to reach out with suggestions and feedback. Contact details are
below.</p>
</section>
<footer class="pv6 center white">
<p class="f6 db lh-solid">
Expand All @@ -75,6 +90,20 @@
</p>
</footer>
</section>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '5b7f2724aef3f80588a4d9d3');
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
t.src = 'https://d2fuc4clr7gvcn.cloudfront.net/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>

</html>
</html>

0 comments on commit fa14618

Please sign in to comment.