pull/2/head
Alpha Chen 3 years ago
parent e8f91aadce
commit de51c827f6

@ -1,13 +0,0 @@
FROM arm32v7/ruby:2.7
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY . .
CMD ["rackup", "--host", "0.0.0.0"]

@ -1,14 +0,0 @@
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "nokogiri"
gem "roda"
group :development do
gem "pry"
gem "rake"
gem "rerun"
end

@ -1,39 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
coderay (1.1.2)
ffi (1.12.1)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
method_source (0.9.2)
mini_portile2 (2.8.0)
nokogiri (1.13.6)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
racc (1.6.0)
rack (2.2.3.1)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
rerun (0.13.0)
listen (~> 3.0)
roda (3.28.0)
rack
PLATFORMS
ruby
DEPENDENCIES
nokogiri
pry
rake
rerun
roda
BUNDLED WITH
2.1.2

@ -1,17 +0,0 @@
desc "Run RZZ in development mode"
task :dev do
sh "rerun -- rackup"
end
namespace :docker do
TAG = "kejadlen/rzz"
task :build do
sh "docker build --tag #{TAG} ."
end
task push: :build do
sh "docker push #{TAG}"
end
end

@ -1,3 +0,0 @@
require_relative "rzz"
run Rzz::App.freeze.app

@ -1,51 +0,0 @@
require "digest/sha1"
require "open-uri"
require "nokogiri"
require "roda"
module Rzz
class App < Roda
plugin :caching
plugin :json
route do |r|
r.get do
r.is "test-gym" do
url = "https://elemental.medium.com/test-gym/home"
html = URI.open(url).read
doc = Nokogiri::HTML(html)
items = doc.xpath("//a[@data-post-id]").map {|a|
attrs = a.attributes
id = attrs.fetch("data-post-id").value
title = a.xpath("./h3").text
content = a.xpath("./div").text
href = URI(attrs.fetch("href"))
url = "#{href.scheme}://#{href.host}#{href.path}"
{ id: id, title: title, content_text: content, url: url }
}
{
version: "https://jsonfeed.org/version/1",
title: "Test Gym",
home_page_url: url,
feed_url: "#{r.base_url}#{r.path}",
items: items,
}
end
end
end
end
end
if __FILE__ == $0
url = "https://elemental.medium.com/feed"
xml = URI.open(url).read
doc = Nokogiri::XML(xml)
require "pry"
binding.pry
end

@ -18,7 +18,7 @@
# Needed for Docker stuff
- docker-compose
- python-pip
- python3-pip
- python-backports-shutil-get-terminal-size
- python-backports.ssl-match-hostname
@ -182,15 +182,6 @@
- traefik.http.routers.pihole.tls.certresolver=le
- traefik.http.services.pihole.loadbalancer.server.port=80
restart: unless-stopped
rzz:
image: kejadlen/rzz:latest
container_name: rzz
labels:
- traefik.enable=true
- traefik.http.routers.rzz.rule=Host(`{{ traefik.host_rules.rzz }}`)
- traefik.http.routers.rzz.tls=true
- traefik.http.routers.rzz.tls.certresolver=le
- traefik.http.services.rzz.loadbalancer.server.port=9292
syncthing:
image: kejadlen/syncthing:latest
container_name: syncthing

Loading…
Cancel
Save