* integrate reviews into website

This commit is contained in:
Reinhard Pointner 2012-12-14 15:23:38 +00:00
parent 0ef8b9710d
commit 1204dc70d0
8 changed files with 243 additions and 10 deletions

View File

@ -2,7 +2,7 @@
// UPDATE release-groups.txt FROM http://scenegrouplist.com/lists_sgl.php
@Grab('org.jsoup:jsoup')
@Grab(group='org.jsoup', module='jsoup', version='1.7.1')
import org.jsoup.*
def sgl = []
@ -168,3 +168,19 @@ names = seriesSorter as List
gz(series_out, names)
println "Series Count: " + names.size()
// prepare reviews from SF.net for website
def reviewPage = retry(10, 1000){ Jsoup.connect('https://sourceforge.net/projects/filebot/reviews/?sort=usefulness&filter=thumbs_up').get() }
def reviews = reviewPage.select('article[itemtype~=Review]').findResults{ article ->
article.select('*[itemprop=reviewBody]').findAll{ !(it.attr('class') =~ /spam/) }.findResults{ review ->
[user:article.select('*[itemprop=name]').text(), date:article.select('*[datetime]').text(), text:review.text()]
}
}.flatten()
use (groovy.json.JsonOutput) {
println "Reviews: ${reviews.size()}"
reviews.toJson().prettyPrint().saveAs('website/reviews.json')
}

View File

@ -28,8 +28,6 @@
<property name="deploy.release" value="web.sourceforge.net:/home/frs/project/f/fi/filebot/filebot" />
<property name="deploy.website" value="web.sourceforge.net:htdocs" />
<property name="deploy.data" value="web.sourceforge.net:htdocs/data" />
<property name="deploy.data.frs" value="web.sourceforge.net:/home/frs/project/f/fi/filebot/data" />
@ -605,10 +603,11 @@
<target name="upload-data" depends="login">
<scp todir="${sf.user}:${sf.password}@${deploy.data}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.website}/data">
<include name=".htaccess" />
<include name="*.txt" />
<scp todir="${sf.user}:${sf.password}@${deploy.website}" trust="yes" verbose="true" sftp="true">
<fileset dir="${dir.website}">
<include name="data/.htaccess" />
<include name="data/*.txt" />
<include name="*.json" />
</fileset>
</scp>
</target>

View File

@ -430,3 +430,54 @@ div.screencast:hover .play {
width: 300px;
margin: 25px auto;
}
.message.box {
background-color: #F5F5F5;
border-radius: 4px;
box-shadow: 0 2px 5px #A2A2A2;
background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
}
.review {
margin: 30px 25px;
display: block;
text-decoration: none !important;
padding: 10px;
min-height: 44px;
max-width: 380px;
}
.review p{
font-size: 11px;
line-height: 18px;
color: #555555;
margin:0px 0px 0px 48px
}
.review .text{
font-family: 'Dawning of a New Day', cursive;
font-size: 24px;
}
.review .user{
font-size: 12px;
font-weight: bold;
color: #0077AA;
vertical-align: baseline;
}
.thumbs {
float:left;
border-radius: 4px 4px 4px 4px;
background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
background-color: #0088BB;
border: 1px solid #006699;
text-align: center;
height: 42px;
width: 42px;
}
.thumbs img{
position:relative;
top: 8px;
}

View File

@ -44,11 +44,11 @@ if ($mode != 's') {
<img src="images/money.png" style="float:left; margin:5px 10px 5px 5px; width:48px; height:48px" />
<p style="margin: 13px 20px">
Shutter at the thought of how many hours and days of time FileBot has saved you?
You can show your appreciation and <b>support for future development</b> by donating!
You can show your appreciation and <b>support for future development</b> by donating.
</p>
</div>
</div>
<iframe src="<? print($downloadPage) ?>" name="sourceforge" width="100%" height="1200" frameBorder="0" scrolling="no" seamless="true"></iframe>
<iframe src="<? print($downloadPage) ?>" name="sourceforge" width="100%" height="1200" frameBorder="0" scrolling="no" seamless="seamless"></iframe>
</body>
</html>
<?

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

View File

@ -23,8 +23,12 @@
<link rel="stylesheet" href="base.css" type="text/css" />
<link rel="icon" href="favicon.png" />
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Dawning+of+a+New+Day' rel='stylesheet' type='text/css'>
<!-- Java Deployment Toolkit -->
<script type="text/javascript" src="http://www.java.com/js/deployJava.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- google analytics -->
<script type="text/javascript">
@ -155,6 +159,29 @@
</a>
</div>
<a id="review" class="review message box" style="display:none" href="reviews.php" target="_blank">
<div class="thumbs up">
<img src="images/thumbs_up.png" />
</div>
<div>
<script type="text/javascript">
$.ajax({
url: 'reviews.json',
dataType: 'json',
success: function(data) {
var review = data[Math.floor(Math.random() * data.length)]
$('#review .user').text(review.user)
$('#review .date').text(review.date)
$('#review .text').text(review.text)
$('#review').show()
}
});
</script>
<p class="head">Posted by <span class="user"></span> on <span class="date"></span></p>
<p class="text quote"></p>
</div>
</a>
<div class="section first tutorial">
<img class="icon" src="images/starthere.png" alt="start" width="48" height="48" />
<h2>Getting Started</h2>
@ -294,7 +321,7 @@
<span class="quote">Will you join us?</span>
<h2>Contact</h2>
<p>
The project is continuously seeking for improvements, so anykind of <a onclick="_gaq.push(['_trackPageview', '/project/feedback'])" target="_blank" href="http://alternativeto.net/software/filebot/reviews">feedback</a> is more than welcome
The project is continuously seeking for improvements, so anykind of <a onclick="_gaq.push(['_trackPageview', '/project/feedback'])" target="_blank" href="https://sourceforge.net/projects/filebot/reviews/?sort=usefulness#review-form">feedback</a> is more than welcome
and if there's any questions or problems just start posting in the <a target="_blank" href="http://filebot.sourceforge.net/forums/">forums</a> or check the <a target="_blank" href="http://filebot.sourceforge.net/forums/viewtopic.php?f=3&amp;t=7"><acronym title="frequently asked questions">FAQ</acronym></a>.
We're social as well. Follow us on <a onclick="_gaq.push(['_trackPageview', '/project/twitter'])" target="_blank" href="https://twitter.com/#!/filebot_renamer">twitter</a> and become a fan on <a onclick="_gaq.push(['_trackPageview', '/project/facebook'])" target="_blank" href="https://www.facebook.com/filebot">facebook</a>.
</p>

92
website/reviews.json Normal file
View File

@ -0,0 +1,92 @@
[
{
"user": "Kate Smith",
"date": "2012-11-05",
"text": "awesome user-interface!"
},
{
"user": "OpenID User",
"date": "2012-11-05",
"text": "Extremely quick and efficient. Great for renaming anime, too - I was very impressed at Filebot's ability to consistently rename anime using AniDB. A must for keeping a large collection clean!"
},
{
"user": "mark",
"date": "2012-03-25",
"text": "one of the most liked \"must have\" programs i use. much thanks to author.!"
},
{
"user": "Amit Singhal",
"date": "2010-05-23",
"text": "one of the best tv-ep renamers out there! kudos! to the author, rednoah"
},
{
"user": "Max",
"date": "2012-11-27",
"text": "Awesome project! Thanks ;)"
},
{
"user": "Pope Michelle",
"date": "2012-11-18",
"text": "I use this software. Thank you for your work."
},
{
"user": "Ryan",
"date": "2012-11-09",
"text": "fast download and works, recommended."
},
{
"user": "Tolentino Lloyd",
"date": "2012-10-22",
"text": "Great software, thank you."
},
{
"user": "ryan peck",
"date": "2012-09-15",
"text": "good work"
},
{
"user": "Zomazi",
"date": "2012-09-03",
"text": "Great tool and getting better!"
},
{
"user": "Ed Doran",
"date": "2012-08-25",
"text": "A must use tool. Really simplifies watching my favorite movies"
},
{
"user": "Kostas",
"date": "2012-08-16",
"text": "Great job! Thank you!"
},
{
"user": "Diana Cate",
"date": "2012-05-18",
"text": "Nice work ! Great project."
},
{
"user": "Gillardino Boccacio",
"date": "2012-05-12",
"text": "indispensable tool for people with a large library of videos. Through this program, I was able to restore order in films and serials. Thank you!"
},
{
"user": "wkunes",
"date": "2012-05-07",
"text": "Great tool and getting better!"
},
{
"user": "Milos Kaurin",
"date": "2012-04-14",
"text": "One of the best (if not the best) multiplatform episode renamer/subtitle downloader"
},
{
"user": "Jackson",
"date": "2012-03-26",
"text": "Stable and works."
},
{
"user": "lakis koulourakis",
"date": "2011-02-18",
"text": "best app on series renaming i could find"
}
]

48
website/reviews.php Normal file
View File

@ -0,0 +1,48 @@
<html>
<head>
<title>Reviews</title>
<link rel="stylesheet" href="base.css" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Dawning+of+a+New+Day' rel='stylesheet' type='text/css'>
<!-- google analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25379256-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="top"><small>Write a review for FileBot at <a href="https://sourceforge.net/projects/filebot/reviews/?sort=usefulness#review-form">SourceForge.net</a></small></div>
<?
// read file
$filename = "reviews.json";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
// parse Json
$reviews = json_decode($contents);
shuffle($reviews);
foreach ($reviews as $review) {
?>
<div class="review message box" style="float:left">
<div class="thumbs up">
<img src="images/thumbs_up.png" />
</div>
<div>
<p class="head">Posted by <span class="user"><? echo $review->user ?></span> on <span class="date"><? echo $review->date ?></span></p>
<p class="text quote"><? echo $review->text ?></p>
</div>
</div>
<?
}
?>
</body>
</html>