Not logged in. · Lost password · Register

All posts by krang (4)

topic: Dead link checker and link status (Plugin request :))  in the forum: General Help and Support Plugins Plugin Wishlist
Avatar
krang #1
User title: Awesome
Member since Jan 2019 · 4 posts · Location: Dimension X
Group memberships: Members
Show profile · Link to this post
Ok I tested it on my wiki in Tor network and it works very well. If someone would like to check the results it is here: http://6s3qqbqolj3qkj76.onion (you need Tor Browser to reach that site)

I modified code a little to allow curl recognize .onion domains. Modification was made in action.php file.
Curl section should look like this:

$ch = curl_init($url);
        //curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . "/certs/cacert.pem");
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
                curl_setopt($ch,CURLOPT_FOLLOWLOCATION);
                curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
                curl_setopt($ch,CURLOPT_TIMEOUT,10);
                curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
                curl_setopt($ch, CURLOPT_PROXY, "localhost:9050");
                $output = curl_exec($ch);
                $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
                curl_close($ch);
                echo "$httpcode";
        return 1;

so changes were made in line, un-comment and set to false:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
and added
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
curl_setopt($ch, CURLOPT_PROXY, "localhost:9050");

Thank you all for your help. DokuWiki community is now one of the best for me.
topic: Dead link checker and link status (Plugin request :))  in the forum: General Help and Support Plugins Plugin Wishlist
Avatar
krang #2
User title: Awesome
Member since Jan 2019 · 4 posts · Location: Dimension X
Group memberships: Members
Show profile · Link to this post
This looks nice. I need some time to analyze this. Also one programmer offer his time to work on this so I am in the middle of negotiation.
Hmm, if I understand good it's hard to avoid JavaScript, building this kind of plugin. But your solution is closest to solution without JavaScript I think.

I am using VPS with Linux so I have access to execute scripts.

Thank you for your post.

EDIT:

ohh one user already create plugin like this: https://www.dokuwiki.org/plugin:xtern
I will test it and if everything will be ok author of plugin will get that 40 USD for great solution.
Thank you. I will test it over the weekend.
This post was edited on 2019-01-22, 19:19 by krang.
topic: Dead link checker and link status (Plugin request :))  in the forum: General Help and Support Plugins Plugin Wishlist
Avatar
krang #3
User title: Awesome
Member since Jan 2019 · 4 posts · Location: Dimension X
Group memberships: Members
Show profile · Link to this post
Ok. Thank you for the link. That is expensive. I will need to find other solution. Anyway. Thanks.
topic: Dead link checker and link status (Plugin request :))  in the forum: General Help and Support Plugins Plugin Wishlist
Avatar
krang #4
User title: Awesome
Member since Jan 2019 · 4 posts · Location: Dimension X
Group memberships: Members
Show profile · Link to this post
Subject: Dead link checker and link status
Aloha,

I am looking for someone who could create a plugin for me. I offer 40 USD (Please provide a price for this kind of customization if you think it is too low) (payment in Bitcoins).

I would like to have a status indicator after each external link on my wiki.
Each link need to be checked after the page is fully loaded. So checking status of external link cannot delay page loading.
Once wiki page is fully loaded each external link is checked and got own status.

First status is "checking" (once page is loaded, this status shows, next to external link symbol, till page is checked, so this is first temporary status, default one, before we get main info about offline or online) - this status icon should be yellow dot -
Second is "online" - page status ok, server response 200 - icon green dot -
Third is "offline" - broken link, server response 404 - red dot -

I think php curl or php wget function can be used for this.
I just know that in standard curl it can be done by running command:
curl -s -o /dev/null -I -L -w "%{http_code}\n" http://google.com
-s - Silent or quiet mode.
-o - Write output to <file> instead of stdout.
-I - Fetch the headers only.
-L - If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.
-w - Make curl display information on stdout after a completed transfer.

I was looking for some info about php-curl and maybe this function could be helpful:

curl_getinfo — Get information regarding a specific transfer
curl_getinfo ( resource $ch [, int $opt ] ) : mixed
where parameter
opt may be one of the following constants:
CURLINFO_RESPONSE_CODE - The last response code.

Thanks in advance!
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-07-23, 13:45:20 (UTC +02:00)