The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Geonode::Free::ProxyList - Get Free Geonode Proxies by using some filters

VERSION

Version 0.0.5

SYNOPSIS

Get Geonode's free proxy list and apply some filters. You can later choose them by random.

    my $proxy_list = Geonode::Free::ProxyList->new();

    $list->set_filter_google('true');
    $list->set_filter_port(3128);
    $list->set_filter_limit(200);

    $list->add_proxies; # Add proxies to the list for current filters

    $list->set_filter_google('false');
    $list->set_filter_port();  # reset filter
    $list->set_filter_limit(); # reset filter
    $list->set_filter_protocol_list( [ 'socks4', 'socks5' ] );
    $list->set_filter_speed('fast');

    $list->add_proxies; # Add proxies to the list for current filters

    # List of proxies is shuffled

    my $some_proxy = $list->get_next;  # Repeats when list is exhausted
    my $other_proxy = $list->get_next; # Repeats when list is exhausted

    my $random_proxy = $list->get_random_proxy;  # Can repeat

    $some_proxy->get_methods();  # [ 'http', 'socks5' ]

    Geonode::Free::Proxy::prefer_socks(); # Will use socks for url, if available

    $some_proxy->get_url(); # 'socks://127.0.0.1:3128';

    Geonode::Free::Proxy::prefer_http(); # Will use http url, if available

    $some_proxy->get_url(); # 'http://127.0.0.1:3128';

    $some_proxy->can_use_http();  # 1
    $some_proxy->can_use_socks(); # 1

    $other_proxy->can_use_socks(); # q()
    $other_proxy->can_use_http();  # 1

    Geonode::Free::Proxy::prefer_socks(); # Will use socks for url, if available

    $some_proxy->get_url(); # 'http://foo.bar.proxy:1234';

SUBROUTINES/METHODS

new

Instantiate Geonode::Free::ProxyList object

reset_proxy_list

Clears proxy list

reset_filters

Reset filtering options

set_filter_country

Set country filter. Requires a two character uppercase string or undef to reset the filter

set_filter_google

Set google filter. Allowed values are 'true'/'false'. You can use undef to reset the filter

set_filter_port

Set port filter. Allowed values are numbers that does not start by zero. You can use undef to reset the filter

set_filter_protocol_list

Set protocol list filter. Allowed values are http, https, socks4, socks5. You can use an scalar or a list of values. By using undef you can reset the filter

set_filter_anonymity_list

Set anonimity list filter. Allowed values are http, https, socks4, socks5. You can use an scalar or a list of values. By using undef you can reset the filter

set_filter_speed

Set speed filter. Allowed values are: fast, medium, slow. You can use undef to reset the filter

set_filter_org

Set organization filter. Requires some non empty string. You can use undef to reset the filter

set_filter_uptime

Set uptime filter. Allowed values are: 0-100 in 10% increments. You can use undef to reset the filter

set_filter_last_checked

Set last checked filter. Allowed values are: 1-9 and 20-60 in 10% increments. You can use undef to reset the filter

set_filter_limit

Set speed filter. Allowed values are numbers greater than 0. You can use undef to reset the filter

set_env_proxy

Use proxy based on environment variables

See: https://metacpan.org/pod/LWP::UserAgent#env_proxy

Example:

$proxy_list->set_env_proxy();

set_proxy

Exposes LWP::UserAgent's proxy method to configure proxy server

See: https://metacpan.org/pod/LWP::UserAgent#proxy

Example:

$proxy_list->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/');

set_timeout

Set petition timeout. Exposes LWP::UserAgent's timeout method

See: https://metacpan.org/pod/LWP::UserAgent#timeout

Example:

$proxy_list->timeout(10);

add_proxies

Add proxy list according to stored filters

get_all_proxies

Return the whole proxy list

get_random_proxy

Returns a proxy from the list at random (with repetition)

get_next

Returns next proxy from the shuffled list (no repetition until list is exhausted)

AUTHOR

Julio de Castro, <julio.dcs at gmail.com>

BUGS

Please report any bugs or feature requests to bug-geonode-free-proxylist at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geonode-Free-ProxyList.

I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Geonode::Free::ProxyList

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2021 by Julio de Castro.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)