Skip to content

Instantly share code, notes, and snippets.

sub get_bookshelf {
my $rep = $ua.get("$bbaseurl$bookid");
if ! $rep.is-success {
die "Can't contact $bbaseurl";
}
# first we need to know the number of page
my $xmldoc = parse-html($rep.content, :TAG<div>, :class<page_list>, :SINGLE, :nowhitespace);
my @pages = $xmldoc.elements(:TAG<li>, :RECURSE);
my $number_of_page;
use Config::Simple::Role;
class Config::Simple does Config::Simple::Role {
multi method new($filename) {
return self.bless(:filename($filename));
}
multi method new($filename, Str :$b) {
my $module = "Config::Simple::$b";
use Gumbo::Parser; # replace with HTML::Parser::XML
use XML;
my $parser = Gumbo::Parser.new;
my $html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/};
say "Getting/parsing a wegpage with a quite huge xml tree, prepare yourself some coffee if you use H:P:X";
say "webpage is "~$html.chars~" size.";
my $xml = $parser.parse($html);
use v6;
use lib './', '/root/testmodif/s/perl6-html-parser-xml/lib/';
use FicClass;
use Gumbo;
use StoryFactory;
use HTTP::UserAgent;
use HTTP::Cookie;
use v6;
use Gumbo;
use XML;
use HTTP::UserAgent;
#We define some base url, notice that I don't use https
my $bbaseurl = "http://www.fimfiction.net/bookshelf/";
my $fimbaseurl = "http://www.fimfiction.net/";
root@testperl6:~/piko/DBIish# perl6 -e 'use NativeCall; sub sqlite3_libversion_number() returns int32 is native("libsqlite3.so") is export { ... }; say sqlite3_libversion_number()'
3008007
root@testperl6:~/piko/DBIish# perl6 -e 'use NativeCall; sub sqlite3_libversion_number() returns Int is native("libsqlite3.so") is export { ... }; say sqlite3_libversion_number()'
895812289686267399
root@testperl6:~/piko/DBIish# uname -a
Linux testperl6 3.16.0-4-586 #1 Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) i686 GNU/Linux
use Gumbo::Parser; # replace with HTML::Parser::XML
use XML;
my $parser = Gumbo::Parser.new;
my $html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/};
say "Getting/parsing a wegpage with a quite huge xml tree, prepare yourself some coffee if you use H:P:X";
say "webpage is "~$html.chars~" size.";
my $xml = $parser.parse($html);
lorom
; $04CB is free ram, let use 12x2 bytes for our changes
!TABLE_ICHANGE = $04CB
!CPY_ORIGINAL_INPUT = $7C
; $80-81 copy of input
!CPY_INPUT = $80
!ROOM_COUNTER = $2B2
local camera_x
local camera_y
local link_x
local link_y
-- $0114
-- $6C[0x01] - Indicates whether you are standing in a doorway
local framestarted = 0
function savestateloaded()
framestarted = 0;
end
event.onloadstate(savestateloaded);
function to_rta(ftime)
local cpy = ftime