コード例 #1
0
    }
    $toc = "<p><span class='bold'>Table of Contents:</span></p><ol id='table-of-contents'>";
    $chapterList = "<p><span class='bold'>Chapters:</span></p><ol id='chapter-list'>";
    for ($i = 0; $i < $story->totalChapters; $i++) {
        $c = $story->chapters[$i];
        // copies relevant chapter for ease of access
        $iplus = $i + 1;
        $toc = $toc . "<li><a href='#chapter-{$iplus}'>" . $c->chapterTitle . "</a></li>";
        $chapterList = $chapterList . "<li id='chapter-{$iplus}'><h3 class='chapter-title'>" . $c->chapterTitle . " <span class='toplink'><a href='#top'>[top]</a></span></h3>" . $c->chapterText . "</li>";
    }
    echo "<p><span class='bold'>Total execution time:</span> " . (microtime(true) - $time_start) . " seconds</p>";
    //////// TESTING PURPOSES
    echo $toc . "</ol>";
    echo $chapterList . "</ol>";
}
ao3($url);
// test document url: https://angush-projects-angush-1.c9users.io/test.html
// Acolyte url: https://forums.spacebattles.com/threads/acolyte-worm-warhammer-40k.311949
//    $doc = new DomDocument;
//    $doc -> validateOnParse = true;
/*    
    require_once 'libs/simple_html_dom.php';
    $url = "https://forums.spacebattles.com/threads/acolyte-worm-warhammer-40k.311949";
    
    if (@file_get_contents($url)) {
        if (strpos($url, "forums.spacebattles.com/threads/")) {
            xenforo("Spacebattles", $url);
        } else if (strpos($url, "forums.sufficientvelocity.com/threads/")) {
            xenforo("Sufficient Velocity", $url);
        } else if (strpos($url, "forum.questionablequesting.com/threads/")) {
            xenforo("Questionable Questing", $url);
コード例 #2
0
require_once 'libs/simple_html_dom.php';
$url = $_GET['url'];
$threadmarked = $_GET['hasThreadmarks'];
$chapters = array();
$chapterTitles = array();
$moreChapters = true;
$title = "";
$author = "";
if (strpos($url, "orums.pacebattles.com/threads/") || strpos($url, "orums.sufficientvelocity.com/threads/") || strpos($url, "orum.questionablequesting.com/threads/")) {
    xenforo();
} else {
    if (strpos($url, "anfiction.net/s/")) {
        ffnet();
    } else {
        if (strpos($url, "rchiveofourown.org/works/")) {
            ao3();
        } else {
            if (strpos($url, "anfiction.net") || strpos($url, "rchiveofourown.org") || strpos($url, "pacebattles.com") || strpos($url, "ufficientvelocity.com") || strpos($url, "uestionablequesting.com")) {
                echo "not story page";
            } else {
                echo "unsupported site";
            }
        }
    }
}
function xenforo()
{
    echo "xenforo";
    /*        if (threadmarked) {
                // if thread has story posts threadmarked