-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
121 lines (117 loc) · 6.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="vendor/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<style>
.partsrow-template {
display: none;
}
#partsrow-table {
counter-reset: rowNumber;
}
#partsrow-table tbody tr:not(.partsrow-template) {
counter-increment: rowNumber;
}
#partsrow-table tbody tr td:first-child::before {
content: counter(rowNumber);
min-width: 1em;
margin-right: 0.5em;
}
.partsrow-draghandle {
float: right
}
</style>
<title>hfy2epub</title>
</head>
<body>
<a href="https://github.com/hacst/hfy2epub"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<div class="container">
<div class="jumbotron">
<h1>hfy2epub</h1>
hfy2epub is web-tool to turn post series from <a href="https://www.reddit.com/r/HFY/">reddit.com/r/HFY</a> into EPUB files for easy offline consumption with a reader or text-to-speech.
All work to identify the posts, fetch them and turn them into an EPUB are performed in the browser.
</div>
<div>
<div class="alert alert-danger">
<b>Note:</b> Be fair to the authors. Do not distribute the resulting EPUB files unless you own the rights to all the material and/or the author gave you permission. In general respect the author's wishes and do not use this tool if the author is not ok with it. When in doubt ask the author.
</div>
</div>
<div>
<form id="retrieveInfoForm">
<div class="form-group">
<label for="startUrl">URL to first post in <a href="https://www.reddit.com/r/HFY/">HFY</a> series or <a href="https://www.reddit.com/r/HFY/wiki/index">wiki</a> story index page:</label>
<input class="form-control" id="startUrl" type="text"/>
<small class="form-text">This script uses heuristics to either follow the "next" links from a given post or to extract the list of parts from a wiki page.</small>
</div>
<div class="form-group">
<label for="nextPostRegex">Regex to identify next post link (not used for wiki)</label>
<input class="form-control" id="nextPostRegex" value="next|epilogue|part|chapter|episode" type="text"/>
<small class="form-text">Tweaking this might help if not all parts of a series are detected. For more information about regular expressions see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">here</a></small>
</div>
<div class="form-group">
<label for="delayBetweenRequests">Delay between requests in seconds</label>
<input class="form-control" id="delayBetweenRequests" type="number" value="2.0" step="0.1">
<small class="form-text">Reddit does not like people hammering their site. Requests from this page will show up as coming from your ip/account. Act accordingly.</small>
</div>
<button class="btn btn-primary form-control" id="retrieveInfoBtn">Retrieve series info</button>
</form>
</div>
<div>
<h2 id="seriesInformationHead">Series information</h2>
<form id="epubMakerForm">
<div class="form-group">
<label for="seriesTitle">Title:</label>
<input class="form-control" id="seriesTitle" type="text"/>
</div>
<div class="form-group">
<label for="seriesAuthor">Author:</label>
<input class="form-control" id="seriesAuthor" type="text"/>
</div>
<div class="form-group">
<label for="partsrow-table">Parts:</label>
<table id="partsrow-table" class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Part title</th>
<th scope="col">URL</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="partsrow partsrow-template">
<td scope="col"><span class="partsrow-draghandle"><span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span><span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span></span></td>
<td class="partsrow-title" contenteditable="true"></td>
<td class="partsrow-url" contenteditable="true"></td>
<td class="partsrow-link"><a target="_blank" href="#"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Visit</a></td>
<td class="partsrow-remove"><a class="partsrow-remove-btn" title="Remove"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>
</tr>
</tbody>
</table>
<p><button id="partsrow-add-btn" class="btn btn-light btn-block" type="button"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add part</button></p>
</div>
<button type="submit" class="btn btn-primary form-control" id="epubMakerBtn">Download EPUB</button>
</form>
</div>
<div>
<br />
<label for="logList">Log:</label>
<ul class="list-group" id="logList"></ul>
</div>
</div>
<script src="vendor/js/jszip.min.js"></script>
<script src="vendor/js/jszip-utils.min.js"></script>
<script src="vendor/js/FileSaver.min.js"></script>
<script src="vendor/js/handlebars.min.js"></script>
<script src="vendor/js/underscore.string.min.js"></script>
<script src="vendor/js/beautify-html.js"></script>
<script src="vendor/js/js-epub-maker.js"></script>
<script src="vendor/js/he.js"></script>
<script src="vendor/Sortable-1.4.0/Sortable.min.js"></script>
<script src="js/hfy2epub.js"></script>
</body>
</html>