From 383ed8b20986fcf1fbd120dba2db94697eecfe3a Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 29 Nov 2017 18:12:23 -0600 Subject: [PATCH] Rename project --- .gitignore | 2 +- README.md | 6 +++--- shard.yml | 6 +++--- src/{visor.cr => invidious.cr} | 12 ++++-------- src/views/layout.ecr | 3 +-- src/views/watch.ecr | 1 + 6 files changed, 13 insertions(+), 17 deletions(-) rename src/{visor.cr => invidious.cr} (94%) diff --git a/.gitignore b/.gitignore index 7c133ca0..070df8db 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ /.shards/ /video_info/ /.vscode/ -visor +invidious diff --git a/README.md b/README.md index f9577869..7876fd8b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# visor +# Invidious Alternative frontend for YouTube @@ -11,12 +11,12 @@ crystal deps ## Usage ```bash -crystal run src/visor.cr +crystal run src/invidious.cr ``` ## Contributing -1. Fork it ( https://github.com/omarroth/visor/fork ) +1. Fork it ( https://gitlab.com/omarroth/invidious/fork ) 2. Create your feature branch (git checkout -b my-new-feature) 3. Commit your changes (git commit -am 'Add some feature') 4. Push to the branch (git push origin my-new-feature) diff --git a/shard.yml b/shard.yml index dc5cb756..3fbae5e2 100644 --- a/shard.yml +++ b/shard.yml @@ -1,12 +1,12 @@ -name: visor +name: invidious version: 0.1.0 authors: - Omar Roth targets: - visor: - main: src/visor.cr + invidious: + main: src/invidious.cr dependencies: kemal: diff --git a/src/visor.cr b/src/invidious.cr similarity index 94% rename from src/visor.cr rename to src/invidious.cr index 1a484c38..5a1c605a 100644 --- a/src/visor.cr +++ b/src/invidious.cr @@ -121,20 +121,16 @@ class VideoInfo ) end - macro templated(filename) render "src/views/#{{{filename}}}.ecr", "src/views/layout.ecr" end context = OpenSSL::SSL::Context::Client.insecure -client = HTTP::Client.new("www.youtube.com", 443, context) - - -video_id = "Vufba_ZcoR0" -video_info = client.get("/get_video_info?video_id=#{video_id}&el=info&ps=default&eurl=&gl=US&hl=en").body - -p VideoInfo.from_json(video_info) +# client = HTTP::Client.new("www.youtube.com", 443, context) +# video_id = "Vufba_ZcoR0" +# video_info = client.get("/get_video_info?video_id=#{video_id}&el=info&ps=default&eurl=&gl=US&hl=en").body +# p VideoInfo.from_json(video_info) get "/" do |env| templated "index" diff --git a/src/views/layout.ecr b/src/views/layout.ecr index 611cf691..93a40f5a 100644 --- a/src/views/layout.ecr +++ b/src/views/layout.ecr @@ -4,7 +4,6 @@ - Visor @@ -12,7 +11,7 @@
diff --git a/src/views/watch.ecr b/src/views/watch.ecr index 6894bf92..199643df 100644 --- a/src/views/watch.ecr +++ b/src/views/watch.ecr @@ -1,3 +1,4 @@ +<%= video_info["title"] %> - Invidious