Skip to content

Commit

Permalink
Updated Twitter script for new project page layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmendenhall committed Aug 7, 2012
1 parent c7c3238 commit 0e2ac2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 69 deletions.
80 changes: 12 additions & 68 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,85 +1,29 @@
<!DOCTYPE html>
<html
itemscope
itemtype="http://schema.org/Application"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<html>
<head>
<link rel="stylesheet" href="/static/bootstrap.css" type="text/css">
<link rel="stylesheet" href="/static/index.css" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Oxygen' rel='stylesheet' type='text/css'>
<title>
Kicksaver: Find and save Kickstarter projects ending soon.
</title>
<meta itemprop="name" content="Kicksaver: Find and save Kickstarter projects ending soon.">
<meta itemprop="description" content="Kicksaver finds Kickstarter projects that will end soon without meeting their funding goals. If you have $20 to spare, you can help save a struggling project!">
<meta itemprop="image" content="http://www.kicksaver.net/static/screenshot.png">
<meta property="og:title" content="Kicksaver: Find and save Kickstarter projects ending soon." />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.kicksaver.net" />
<meta property="og:image" content="http://www.kicksaver.net/static/screenshot.png" />
<meta property="og:site_name" content="Kicksaver" />
<meta property="fb:admins" content="10134383" />
<meta property="og:description"
content="Kicksaver finds Kickstarter projects that will end soon without
meeting their funding goals. If you have $20 to spare, you can
help save a struggling project!"/>
<script type="text/javascript" src="static/analytics.js"></script>
<style>
.input-min { width: 30px; }
</style>
</head>
<body>
<div class="container">
<div class="hero-unit">
<h1>Kick<span class="green">saver</span></h1>
<h3>Find and save <a href="http://kickstarter.com" class="incognito">Kickstarter</a> projects ending soon.</h3>
<div class="row">
<div class="span3 well">
<h1>Kicksaver</h1>
Find projects ending soon.
</div>
</div>
<div class="row">
<div class="span6 well">
<div class="span5 well projectform">
<form action="/project" class="form-inline">
<div class="input-prepend">
<p>I'm willing to spend up to <span class="add-on">$</span><input type="text" value="100" name="b" class="input-min">
<p>I'm willing to spend up to <span class="add-on">$</span><input type="text" value="50" name="b" class="input-min">
to save a struggling project.</p>
</div>
<input type="submit" value="Save something!" class="btn btn-large btn-success">
<input type="submit" value="Save something!" class="btn">
</form>
</div>
<div class="span3 well infobox">
<p>Follow <strong><a href="http://twitter.com/Kicksaver">@Kicksaver</a></strong> for live updates on projects ending soon.</p>
<ul class="like-buttons unstyled">
<li class="twitter-like">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Kicksaver: Find and save Kickstarter projects ending soon."
data-via="Kicksaver" data-count="none">Tweet</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="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</li>
<li class="g-plus-one">
<g:plusone size="medium" annotation="none"></g:plusone>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</li>
<li class="fb-like">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=101479082512";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.kicksaver.net" data-send="false" data-layout="button_count" data-width="80" data-show-faces="false">
</ul>
<div>
<p id="about">
<strong><a href="/about"class="about pull-right">About</a></strong>
</p>
</div>

</div>
</div>
</div>
</div>
</body>
2 changes: 1 addition & 1 deletion twitterscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def tweet_project(project, api):
tweet_string = '"%s" is $%d from its goal with %s left: %s'
p = urlopen(project.link).read()
project_soup = BeautifulSoup(p)
escaped_name = project_soup.select('#name')[0].get_text()[1:-1]
escaped_name = project_soup.select('#title')[0].get_text()[1:-1]
name = HTMLParser.HTMLParser().unescape(escaped_name)
end_time = project_soup.select('.ksr_page_timer')[0]['data-end_time']
end_struct = strptime(end_time[:-6], '%a, %d %b %Y %H:%M:%S')
Expand Down

0 comments on commit 0e2ac2a

Please sign in to comment.