#$nextPageLink = getNextLink($nextLink);
#parsePage($html1);
#print "Next page link: " . $nextPageLink . "\n";
print "title, author, year, addinfo, publisher, abstract" . "\n";
#scraperwiki::sqliteexecute("create table acmdata1 (a int, `title` string, 'author' string, 'year' string, 'addinfo' string, 'publisher' string, 'abstract' string)");
$maxPages = 0;
$numrecords = 1;
while (strlen($nextPageLink) > 0 and $maxPages < 6) {
    $maxPages++;
    #print "Moving on to next page" . "\n";
    $html_content = scraperWiki::scrape($nextPageLink);
    $html1 = str_get_html($html_content);
    #print $html1 . "\n";
    $nextLink = $html1->find("td[@colspan='2']", 0);
    # print "Next link: " . $nextLink->innertext . "\n";
    $nextPageLink = getNextLink($nextLink);
    $numrecords = parsePage($html1, $maxPages);
    sleep(120);
}
print "No further pages" . "\n";
$data = scraperwiki::select("* from acmdata1");
print "<html><table>";
print "<tr><th>Title</th><th>Author</th><th>Year</th><th>AddInfo</th><th>Publisher</th><th>Abstract</th>";
foreach ($data as $d) {
    print "<tr>";
    print "<td>" . "ACM" . "</td>";
    print "<td>" . $d["title"] . "</td>";
    print "<td>" . $d["author"] . "</td>";
    print "<td>" . $d["year"] . "</td>";
    print "<td>" . $d["addinfo"] . "</td>";
    print "<td>" . $d["publisher"] . "</td>";
Ejemplo n.º 2
0
            echo getPageLink($p);
            ?>
"><?php 
            echo $p;
            ?>
</a></li>
                        <?php 
        }
        ?>
                <?php 
    }
}
?>

                <?php 
if (getCurrentPage() !== getMaxPage()) {
    ?>
                    <li><a href="<?php 
    getNextLink();
    ?>
"><i class="material-icons">chevron_right</i></a></li>
                <?php 
}
?>
            </ul>
        </div>
    </div>
</div>

<?php 
get_footer();