# -G Lade Statistik zu GC.com hoch
# -g Nur HTML Seiten erstellen
$ geolog -g -G
Lade Anmeldeseite ... [------------] Angemeldet!
Lade die 'Edit Profile' Seite ... .[----]
Sende Profil ... .[ There is no form with ID "aspnetForm" at ./geolog2.93h.pl line 7385.
Es ist ein Fehler aufgetreten: There is no form with ID "aspnetForm" at /usr/lib/perl5/vendor_perl/5.26.2/WWW/Mechanize.pm line 1941.
my ($version) = "2.93h";
my ($version) = "2.93i";
form_number => 2,
form_number => 1,
my ($version) = "2.93i";
my ($version) = "2.93j";
/<a href=\"\/about\/cache_types.aspx\" target=\"_blank\" title=\"About Cache Types\".*?<img src=\"\/images\/WptTypes\/[0-9]+\.gif\" alt=\"(.*?)\" title/si;
/<a href=\"\/about\/cache_types.aspx\" target=\"_blank\" title=\"(.*?)\" class=\"cacheImage\">/si;
wrtlbrmpft schrieb:Nun wurde wieder mal die Cache-Seite umgestellt und der Cache-Typ war nicht mehr zu erkennen.
my ($version) = "2.93j";
my ($version) = "2.93k";
'Username' => $user,
'UsernameOrEmail' => $user,
marsipulami0815 schrieb:Danke. Geht wieder.
--- geolog.pl-2.92 2015-08-07 16:36:00.000000000 +0200
+++ geolog.pl-2.93k 2018-12-29 16:40:36.971737394 +0100
@@ -75,7 +75,7 @@ require utf8;
no utf8;
-my ($version) = "2.92";
+my ($version) = "2.93k";
my ($geolog_agent) = "Geolog/$version ($^O)";
my ($mozilla_browser) = "User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6";
@@ -148,7 +148,7 @@ my $logConf = q(
log4perl.appender.Logfile.Filter = LogFilter
log4perl.filter.LogFilter = Log::Log4perl::Filter::LevelRange
- log4perl.filter.LogFilter.LevelMin = INFO
+ log4perl.filter.LogFilter.LevelMin = TRACE
log4perl.filter.LogFilter.LevelMax = FATAL
log4perl.filter.LogFilter.AcceptOnMatch = true
@@ -259,8 +259,8 @@ my ($loginURL) = "https://www.geocachi
my ($logsURL) = "http://www.geocaching.com/my/logs.aspx";
my ($parkingURL) = "http://www.geocaching.com/images/attributes/parking-yes.gif";
my ($publicURL) = "http://www.geocaching.com/images/attributes/public-yes.gif";
-my ($profileURL) = "http://www.geocaching.com/profile/";
-my ($accountURL) = "http://www.geocaching.com/myaccount/settings/preferences";
+my ($profileURL) = "https://www.geocaching.com/profile/";
+my ($accountURL) = "https://www.geocaching.com/account/settings/preferences";
my ($logBookURL) = "http://www.geocaching.com/seek/geocache.logbook";
my ($logBookStartURL) = "http://www.geocaching.com/seek/cache_logbook.aspx";
@@ -3726,7 +3726,7 @@ sub post_html {
my ( $url, $av_sleep, $nl, $notlogin, @postparams ) = @_;
my ( $req, $resp );
my ($retry) = 2;
- TRACE "<$url><$av_sleep><$nl><$notlogin><&postparams>";
+ TRACE "<$url><$av_sleep><$nl><$notlogin><@postparams>";
init_browser() if ( !defined($browser) );
$url = url($url);
@@ -3836,7 +3836,7 @@ sub get_cache_listing_page {
}
}
- Encode::from_to( $content, "utf8", "iso-8859-1" );
+ #Encode::from_to( $content, "utf8", "iso-8859-1" );
$content =~ s/\r//g if ($rem_cm);
if ( $wpt eq "" ) {
@@ -3916,10 +3916,7 @@ sub init_ua {
sub init_browser {
TRACE "";
#$browser = WWW::Mechanize::GZip->new(ssl_opts => { SSL_version => 'SSLv3', SSL_cert_file => Mozilla::CA::SSL_ca_file() });
-# $browser = WWW::Mechanize::GZip->new(ssl_opts => { SSL_version => 'TLSv1'});
-###20150801 https://forum.geoclub.de/viewtopic.php?f=103&t=72200&start=20
- $browser = WWW::Mechanize::GZip->new(ssl_opts => {verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE });
-###20150801 https://forum.geoclub.de/viewtopic.php?f=103&t=72200&start=20
+ $browser = WWW::Mechanize::GZip->new(ssl_opts => { SSL_version => 'TLSv1_2'});
$browser->agent_alias('Windows Mozilla');
$browser->add_handler( response_data => \&cb_count );
@@ -3953,7 +3950,7 @@ sub login {
$resp = $browser->get($loginURL);
$content = $browser->content();
TRACE("Content: $content");
- if ( $content =~ /You are logged in as/msi ) {
+ if ( $content =~ /ctl00_uxLoginStatus_divSignedIn/msi ) {
INFO( $EN
?"] Still logged in ...\n"
:"] Immer noch angemeldet ... \n"
@@ -3972,12 +3969,11 @@ sub login {
do {
$browser->submit_form(
- form_name => 'aspnetForm',
+ form_number => 1,
fields => {
- 'ctl00$ContentBody$tbUsername' => $user,
- 'ctl00$ContentBody$tbPassword' => $password,
- },
- button => 'ctl00$ContentBody$btnSignIn'
+ 'UsernameOrEmail' => $user,
+ 'Password' => $password,
+ }
);
$content = $browser->content();
TRACE("Content: $content");
@@ -3991,7 +3987,7 @@ sub login {
);
}
#if ( $content =~ /You are logged in as/msi ) {
- if ( $content =~ /class=\"LoginContainer LoggedIn\"/msi ) {
+ if ( $content =~ /\/my\/default\.aspx/msi ) {
INFO( $EN
?"] Logged in!\n"
:"] Angemeldet!\n"
@@ -3999,7 +3995,7 @@ sub login {
$loggedin = 1;
}
# elsif ( $content =~ /Your username\/password combination does not match. Make sure you entered your information correctly./msi )
- elsif ( $content =~ /class=\"FormSummaryWidget FormErrorWidget/msi )
+ elsif ( $content =~ /class=\"validation-summary-errors/msi )
{
INFO( $EN
?"\nLogin error!!\nPlease specify password for \"$username\": "
@@ -6236,6 +6232,7 @@ sub cachecoords {
if( $text =~ /\"oldLatLngDisplay\":\"(.*?)\"}};/si)
{
$text = $1;
+ Encode::from_to( $text, "utf8", "iso-8859-1" );
if($text =~ /([N|S] [0-9]+° [0-9]+.[0-9]+)'( [E|W] [0-9]+° [0-9]+.[0-9]+)'/si)
{
$coords = $1 . $2;
@@ -6245,6 +6242,7 @@ sub cachecoords {
elsif($text =~ /<span id=\"uxLatLon\">(.*?)<\/span>/si)
{
$text = $1;
+ Encode::from_to( $text, "utf8", "iso-8859-1" );
#coordinates not modified. use the coords from page
if($text =~ /([N|S] [0-9]+° [0-9]+.[0-9]+)( [E|W] [0-9]+° [0-9]+.[0-9]+)/si)
{
@@ -6262,9 +6260,9 @@ sub cachetype {
my ($type);
my ($mytype) = "";
$text =~
- /<a href=\"\/about\/cache_types.aspx\" target=\"_blank\" title=\"About Cache Types\"><img src=\"\/images\/WptTypes\/[0-9]+\.gif\" alt=\"(.*?)\" title/si;
+ /<a href=\"\/about\/cache_types.aspx\" target=\"_blank\" title=\"(.*?)\" class=\"cacheImage\">/si;
$type = $1;
-
+ Encode::from_to( $type, "utf8", "iso-8859-1" );
LOOP:
{
foreach my $cachetype (@cacheTypeTable)
@@ -6291,6 +6289,7 @@ sub cachecontainer {
if ( $text =~ m%<img src=\"/images/icons/container/.*?\.gif\" alt=\"$langField{'size'}: (.*?)\"%si )
{
$container = $1;
+ Encode::from_to( $container, "utf8", "iso-8859-1" );
#Switch container name to containerindex
$containerIndex = -1;
LOOP: {
@@ -6558,7 +6557,7 @@ sub cacheattributes {
while ( $text =~ /\/images\/attributes\//s )
{
- $text =~ /\/images\/attributes\/(.*?)\.gif(.*)/si;
+ $text =~ /\/images\/attributes\/(.*?)\.png(.*)/si;
$text = $2;
if ( $1 ne "alert-on" && $1 ne "attribute-blank" ) {
if ( $attr eq "" ) {
@@ -6660,7 +6659,7 @@ sub download_or_compare_log_pictures {
while ( $content =~ m%<p class="AlignCenter">%si ) {
- if ( $content =~ m%<img alt=.*?src=\"(http://img\.geocaching\.com/cache/log)/thumb(/.*?)(\.gif|\.jpg|\.png|\.jpeg|\.tiff|\.bmp)\".*?>.*?<small>(.*?)<\/small>(.*?)$%si )
+ if ( $content =~ m%<img alt=.*?src=\"(https://img\.geocaching\.com/cache/log)/thumb(/.*?)(\.gif|\.jpg|\.png|\.jpeg|\.tiff|\.bmp)\".*?>.*?<span>(.*?)<\/span>(.*?)$%si )
{
$picname = beautify_name($4);
$picurl = $1 . $2 . $3;
@@ -7386,7 +7385,7 @@ sub upload_gccom_profile {
INFO( $EN ? "]\nSend profile ... ": "]\nSende Profil ... " );
rsleep($sleeppage);
$browser->submit_form(
- form_name => 'aspnetForm',
+ form_id => 'aspnetForm',
fields => {
'ctl00$ContentBody$uxProfileDetails' =>
( suck_in( $directory . "/gcprofile." . $htmlext ) )
@@ -11579,32 +11578,7 @@ sub get_picture_logs {
);
return;
}
- if ( $content =~
- /<input type="hidden" name="__VIEWSTATE1" id="__VIEWSTATE1" value="([^"]*?)"/si
- )
- {
- $viewstate1 = $1;
- }
- else {
- ERROR ( $EN
- ? "Could not identify VIEWSTATE1 value\n"
- : "Konnte VIEWSTATE1-Wert nicht finden\n"
- );
- return;
- }
- if ( $content =~
- /<input type="hidden" name="__VIEWSTATEFIELDCOUNT" id="__VIEWSTATEFIELDCOUNT" value="([^"]*?)"/si
- )
- {
- $viewstatefieldcount = $1;
- }
- else {
- ERROR ( $EN
- ? "Could not identify VIEWSTATEFIELDCOUNT value\n"
- : "Konnte VIEWSTATEFIELDCOUNT-Wert nicht finden\n"
- );
- return;
- }
+
if ( $content =~ /ctl00_ContentBody_ProfilePanel1_lnkGallery.*?href="javascript:__doPostBack\('(.*?)',''\)">.*?ctl00_ContentBody_ProfilePanel1_lnkLists/si )
{
$eventtarget = $1;
@@ -11624,9 +11598,7 @@ sub get_picture_logs {
$profileURL, $sleeppage, 0, 0,
__EVENTTARGET => $eventtarget,
__EVENTARGUMENT => '',
- __VIEWSTATEFIELDCOUNT => $viewstatefieldcount,
__VIEWSTATE => $viewstate,
- __VIEWSTATE1 => $viewstate1
);
$content = $resp->content;
store_file( $content, $directory . "/saving/pics_$count.html", 0, 0 )
@@ -11650,30 +11622,6 @@ sub get_picture_logs {
);
return;
}
- if ( $content =~ /<input type="hidden" name="__VIEWSTATE1" id="__VIEWSTATE1" value="([^"]*?)"/si )
- {
- $viewstate1 = $1;
- }
- else {
- ERROR ( $EN
- ? "Could not identify VIEWSTATE1 value\n"
- : "Konnte VIEWSTATE1-Wert nicht finden\n"
- );
- return;
- }
- if ( $content =~
- /<input type="hidden" name="__VIEWSTATEFIELDCOUNT" id="__VIEWSTATEFIELDCOUNT" value="([^"]*?)"/si
- )
- {
- $viewstatefieldcount = $1;
- }
- else {
- ERROR ( $EN
- ? "Could not identify VIEWSTATEFIELDCOUNT value\n"
- : "Konnte VIEWSTATEFIELDCOUNT-Wert nicht finden\n"
- );
- return;
- }
if ($count > $numberofPages)
{
@@ -11690,7 +11638,7 @@ sub findloggcids {
my (@result) = ();
TRACE "<$text>";
- while ( $text =~ m|http://www\.geocaching\.com\/seek/log\.aspx\?LUID=([^&]*?)&IID=|gsi )
+ while ( $text =~ m|https://www\.geocaching\.com\/seek/log\.aspx\?LUID=([^&]*?)&IID=|gsi )
{
if ( defined( $luid2gcid{$1} ) ) {
push( @result, $luid2gcid{$1} );
@@ -11997,7 +11945,7 @@ sub db_putGcUser {
%dbuser = %user;
}
- $sql = qq(INSERT OR REPLACE INTO gcUserTable (name, luid, userid) VALUES ( \"$dbuser{'name'}\", \"'$dbuser{'luid'}'\", \"$dbuser{'userid'}\" ));
+ $sql = qq(INSERT OR REPLACE INTO gcUserTable (name, luid, userid) VALUES ( \"$dbuser{'name'}\", \"$dbuser{'luid'}\", \"$dbuser{'userid'}\" ));
$sth = $db->prepare($sql);
$sth->execute;
}
@@ -12060,8 +12008,8 @@ sub get_date_format {
my ($content) = @_;
TRACE "<content>";
INFO( $EN
- ? "\n Search for date format"
- : "\n Suche Datumsformat"
+ ? "\n Search for date format "
+ : "\n Suche Datumsformat "
);
if ( $content =~ /<select.*? id=\"SelectedDateFormat\".*?>(.*?)<\/select>/si )
{
@@ -12118,7 +12066,7 @@ sub get_language
{
INFO( $EN
? "Could not identify selected language"
- : "Konnte ausgewaehltes Sprache nicht identifzieren"
+ : "Konnte ausgewaehlte Sprache nicht identifzieren"
);
return "";
}
@@ -12126,7 +12074,7 @@ sub get_language
else {
INFO($EN
? "Could not identify selected language"
- : "Konnte ausgewaehltes Sprache nicht identifzieren"
+ : "Konnte ausgewaehlte Sprache nicht identifzieren"
);
return "";
}
@@ -12201,11 +12149,11 @@ sub getNameFromUid {
$content = get_user_profile_page( $guid, 1 );
- if ( $content =~ m%<span id=\"ctl00_ContentBody_lblUserProfile\".*?>$langField{'profileFor'} .*?: (.*?)</span>.*?id=\"ctl00_ContentBody_ProfilePanel1_lnkSeePosts.*?\&\;mid=(.*?)\"%si )
+ if ( $content =~ m%<a id=\"ctl00_ProfileHead_ProfileHeader_lnkSeePosts\".*?/profile/(.*?)-(.*?)/content/\">%si )
{
- $user{'name'} = $1;
+ $user{'name'} = $2;
$user{'luid'} = $guid;
- $user{'userid'} = $2;
+ $user{'userid'} = $1;
}
else {
$name = "UNKOWN (GC layout changed!)";
C:\>perl c:\zumtesten\geolog.pl
Number found where operator expected at c:\zumtesten\geolog.pl line 1, near "2.92 2015"
(Missing operator before 2015?)
Number found where operator expected at c:\zumtesten\geolog.pl line 1, near "07 16"
(Missing operator before 16?)
Bareword found where operator expected at c:\zumtesten\geolog.pl line 2, near "2.93k"
(Missing operator before k?)
Number found where operator expected at c:\zumtesten\geolog.pl line 2, near "k 2018"
(Do you need to predeclare k?)
Number found where operator expected at c:\zumtesten\geolog.pl line 2, near "29 16"
(Missing operator before 16?)
Array found where operator expected at c:\zumtesten\geolog.pl line 3, near "@@"
(Missing semicolon on previous line?)
Array found where operator expected at c:\zumtesten\geolog.pl line 3, near "7 @@"
(Missing operator before @@?)
Can't modify constant item in predecrement (--) at c:\zumtesten\geolog.pl line 1, near "geolog."
syntax error at c:\zumtesten\geolog.pl line 1, near "2.92 2015"
Illegal octal digit '8' at c:\zumtesten\geolog.pl line 1, at end of line
BEGIN not safe after errors--compilation aborted at c:\zumtesten\geolog.pl line 5.