Add a static homepage.
This commit is contained in:
parent
d03aa93b20
commit
44e7a5a555
4 changed files with 47 additions and 41 deletions
BIN
app/assets/images/karlsruher.png
Normal file
BIN
app/assets/images/karlsruher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -1,6 +1,36 @@
|
|||
// Place all the styles related to the Reposts controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
|
||||
body { background-color: #ffffff; font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; }
|
||||
.logo-red { color: red; }
|
||||
.logo-black { color: black; }
|
||||
a {
|
||||
color: orange;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 25px;
|
||||
margin-top: 15%;
|
||||
margin-bottom: 25px;
|
||||
margin-left: 20px;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
h1 a {
|
||||
text-decoration: none;
|
||||
}
|
||||
div {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.bio {
|
||||
margin-top: 3ex;
|
||||
margin-bottom: 3ex;
|
||||
}
|
||||
.widget {
|
||||
margin-top: 3ex;
|
||||
}
|
||||
|
||||
/* flash messages */
|
||||
#error {
|
||||
background-color: red;
|
||||
|
|
|
|||
|
|
@ -4,29 +4,6 @@ require 'uri'
|
|||
|
||||
class RepostsController < ApplicationController
|
||||
def index
|
||||
config = YAML.load_file('config/client.yml')
|
||||
client_id = config["client_id"]
|
||||
client_secret = config["client_secret"]
|
||||
|
||||
# connect to ADN via a user token
|
||||
uri = URI.parse("https://account.app.net/oauth/authenticate")
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
http.use_ssl = true
|
||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
|
||||
response = Net::HTTP::post_form( uri, {"client_id" => client_id, "response_type" => "code", "redirect_uri" => "http://repostmentions.sr-rolando.com/", "scope" => "stream"})
|
||||
|
||||
# [temp] status
|
||||
@res_code = response.code
|
||||
@res_message = response.message
|
||||
@res_class = response.class.name
|
||||
|
||||
if not response.is_a?(Net::HTTPSuccess)
|
||||
flash[:error] = "Could not connect to ADN."
|
||||
return
|
||||
end
|
||||
|
||||
# ...
|
||||
end
|
||||
|
||||
# TODO: to secure the cronjob call test for 'InvokationPassword' header.
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
<p>
|
||||
This is the helping hand behind the reposts of the <a href="https://alpha.app.net/karlsruher">@Karlsruher</a> on <a href="https://join.app.net/">App.net</a>.
|
||||
</p>
|
||||
<h1><a href="https://alpha.app.net/karlsruher"><span class="logo-black">@</span><span class="logo-red">Karlsruher</span></a></h1>
|
||||
|
||||
<p>
|
||||
There is nothing much to see here directly, though.
|
||||
</p>
|
||||
<div class="bio">
|
||||
Ich retweete automatisch alle Posts, die mich mit @Karlsruher
|
||||
erreichen.<br />
|
||||
|
||||
<% flash.each do |name, msg| %>
|
||||
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
|
||||
<a class="close" data-dismiss="alert">×</a>
|
||||
<%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reposts alle 5 Minuten.<br />
|
||||
|
||||
<p>
|
||||
<h3>Response</h3>
|
||||
code: <%= @res_code %><br />
|
||||
message: <%= @res_message %><br />
|
||||
class: <%= @res_class %>
|
||||
</p>
|
||||
Erstellt von <a
|
||||
href="https://alpha.app.net/sr_rolando">@sr_rolando</a>. Idee von <a
|
||||
href="https://alpha.app.net/karlsruher">@syn2</a>.
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Den Code hinter dem Automatismus gibt's hier: <a href="https://bitbucket.org/sr_rolando/adn-repostmentions">https://bitbucket.org/sr_rolando/adn-repostmentions</a>
|
||||
</div>
|
||||
|
||||
<div class="widget">
|
||||
<a href='https://alpha.app.net/karlsruher' class='adn-button' target='_blank' data-type='follow' data-width='277' data-height='27' data-user-id='@karlsruher' data-show-username='1' rel='me'>Follow me on App.net</a><script>(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//d2zh9g63fcvyrq.cloudfront.net/adn.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'adn-button-js'));</script>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue