Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello i would like to know how i can print only the data-user-id from the source code of the script i have.

use strict;
use LWP::Simple;
use HTML::TokeParser;

my $content = get("https://twitter.com/joshuakhane");
die "Couldn't get it!" unless defined $content;

my $stream = HTML::TokeParser->new(\$content);

while (my $token = $stream->get_token) {
if ($token->[0] eq 'T') { # text
# process the text in $token->[1]
print $token->[1];
}
}

data-user-id="25971071" is inside of the source code and i would like to get only that.
Anybody who could help?

Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900