hydrus/help/downloader_parsers.html

29 lines
2.3 KiB
HTML
Raw Normal View History

2018-02-14 21:47:18 +00:00
<html>
<head>
<title>downloader - parsers</title>
<link href="hydrus.ico" rel="shortcut icon" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
<p><a href="downloader_url_classes.html"><---- Back to URL Classes</a></p>
2018-02-28 22:30:36 +00:00
<p class="warning">This system is still under construction in places! Even when it is done, it will only be for advanced users!</p>
2018-02-14 21:47:18 +00:00
<h3>parsers</h3>
<p>In hydrus, a parser is an object that takes a single block of HTML or JSON data (as returned by a URL) and returns many kinds of hydrus-level metadata.</p>
2018-02-28 22:30:36 +00:00
<p>Parsers are flexible and potentially quite complicated. You might like to open <i>network->manage parsers</i> and explore the UI as you read these pages. Check out how the default parsers already in the client work, and if you want to write a new one, see if there is something already in there that is similar--it is usually easier to duplicate an existing parser and then alter it than to create a new one from scratch every time.</p>
<p>There are three main components in the parsing system (click to open each component's help page):</p>
2018-02-14 21:47:18 +00:00
<ul>
2018-02-28 22:30:36 +00:00
<li><a href="downloader_parsers_formulae.html"><b>Formulae:</b></a> Take parsable data, search it in some manner, and return 0 to n strings.</li>
<li><a href="downloader_parsers_content_parsers.html"><b>Content Parsers:</b></a> Take parsable data, apply a formula to it to get some strings, and apply a single metadata 'type' and perhaps some additional modifiers.</li>
2018-03-07 22:48:29 +00:00
<li><a href="downloader_parsers_page_parsers.html"><b>Page Parsers:</b></a> Take parsable data, apply content parsers to it, and return all the metadata in an appropriate structure.</li>
2018-02-14 21:47:18 +00:00
</ul>
2018-02-28 22:30:36 +00:00
<p>Once you are comfortable with these objects, you might like to check out these walkthroughs, which create full parsers from nothing:</p>
2018-02-14 21:47:18 +00:00
<ul>
2018-02-28 22:30:36 +00:00
<li><a href="downloader_parsers_full_example_file_page.html">gelbooru HTML file page</a></li>
<li><a href="downloader_parsers_full_example_gallery_page.html">e621 HTML gallery page</a></li>
<li><a href="downloader_parsers_full_example_thread.html">8chan JSON thread API</a></li>
2018-02-14 21:47:18 +00:00
</ul>
2018-02-28 22:30:36 +00:00
<p class="right"><a href="downloader_searches.html">Taken a break? Now let's learn about Searches ----></a></p>
2018-02-14 21:47:18 +00:00
</div>
</body>
</html>