App-DuckPAN

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  Change: be2f8b9d3c0582c5461953478c974358120b275a
  Author: Zaahir Moolla <moollaza@duckduckgo.com>
  Date : 2015-05-18 23:58:01 +0000

    reorg variable declarations, small fixes 

  Change: 0ed979934bb5b4e53e835730e01bbee2d80b41a9
  Author: Zaahir Moolla <moollaza@duckduckgo.com>
  Date : 2015-05-18 23:42:17 +0000

    remove unneeded escapes 

  Change: 596da3a04b75c01aa50b018809906bdf3f63e658
  Author: Zaahir Moolla <moollaza@duckduckgo.com>
  Date : 2015-05-18 23:29:22 +0000

    resolve merge conflicts 

  Change: 5f22c4cd1bcab58d482b30cb15079c6d2f86bbe3
  Author: Zaahir Moolla <moollaza@fastmail.fm>
  Date : 2015-05-18 19:25:22 +0000

Changes  view on Meta::CPAN


  Change: 76a5bd2f0216a5a0e03317ac3d174b98d6b3b100
  Author: Dylan Lloyd <dylan@dylansserver.com>
  Date : 2013-03-09 16:01:14 +0000

    Fix for strings with extra newlines/carriage returns

    The \n escaping is working fine, but for HTML output that still has
    weird returns, Javascript will take that as a newline and throw an
    "Unterminated string literal" error in the browser-side. Removing \R
    after the \n have been escaped solves the issue.

    Thank you to bureado <https://github.com/bureado>, who authored this
    change and commit. 

  Change: e8c710baa7348b9b8f8013fc5cbf832a64416b3d
  Author: Dylan Lloyd <dylan@dylansserver.com>
  Date : 2013-02-21 12:42:47 +0000

    updated plain old documentation 

Changes  view on Meta::CPAN

  Date : 2012-11-30 11:16:22 +0000

    Added static files test feature (beta) 

  Change: 99c3db474f06c07bee27ba0eebb2808b0d93152c
  Author: Jag Talon <talon.jag@gmail.com>
  Date : 2012-09-11 15:22:52 +0000

    Fixed the UTF8 problem on Duckpan:

    - Changed uri_escape() to uri_escape_utf8(). 

  Change: 330c7d27fa21453bbc24c5d8eeeb2ed9c620ab87
  Author: moollaza <moollaza@gmail.com>
  Date : 2012-09-03 20:33:36 +0000

    fixed MooX::Options version number 

  Change: a735a045223d00abb3fe61576b1d68af50e43aeb
  Author: moollaza <moollaza@gmail.com>
  Date : 2012-09-03 20:27:24 +0000

Changes  view on Meta::CPAN

  Change: 96926d7e30cf3d12317884842312e62c9a12cc5f
  Author: Michael Smith <crazedpsyc@duckduckgo.com>
  Date : 2012-06-16 14:41:12 +0000

    remove an extra debugger 

  Change: 42818dd3f048df73ee8b1eb927050d375cd7967a
  Author: Michael Smith <crazedpsyc@duckduckgo.com>
  Date : 2012-06-16 14:40:04 +0000

    escape newlines _right_... 

  Change: 8c6f29b82b967c6952251ce5a79f92141f2f113c
  Author: Michael Smith <crazedpsyc@duckduckgo.com>
  Date : 2012-06-16 14:09:23 +0000

    escape newlines in spice return 

  Change: c4b1d1e9e01589724908713912531e4d3df7d49a
  Author: Michael Smith <crazedpsyc@duckduckgo.com>
  Date : 2012-06-15 22:08:49 +0000

    handle spice string wrappers in duckpan too... 

  Change: 7e6aa202e38fc009ac4c82d00c442c83d91190e3
  Author: Torsten Raudssus <torsten@raudss.us>
  Date : 2012-06-08 00:43:11 +0000

Changes  view on Meta::CPAN

  Author: moollaza <moollaza@gmail.com>
  Date : 2012-05-30 20:12:31 +0000

    rq template-for-spice error fixed -- removed [PodWeaver] from
    dist.ini 

  Change: efdd86b1a6a9f2f4c7e5c180ea55b75a6897eefe
  Author: Torsten Raudssus <torsten@raudss.us>
  Date : 2012-05-30 20:40:43 +0000

    Added uri escaped query replacement, fixed load test impossibility 

  Change: b42c356025f3023b8f99c61fcf47cdd631e70a35
  Author: Torsten Raudssus <torsten@raudss.us>
  Date : 2012-05-29 04:06:56 +0000

    And the next bug in dist.ini fixed with new plugin ;) 

  Change: 0c9cdffdffb879edfb242d1f2be1ac5d01f1d96e
  Author: Torsten Raudssus <torsten@raudss.us>
  Date : 2012-05-29 03:48:40 +0000

lib/App/DuckPAN/Fathead.pm  view on Meta::CPAN

	my ( $self ) = @_;

	# Open output.txt file for searching
	# Handles as a CSV with "\t" separator
	# Provide numbered column names
	my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
		f_dir                   => $self->output_txt->parent,
		f_ext                   => ".txt/r",
		csv_sep_char            => "\t",
		csv_quote_char          => undef,
		csv_escape_char         => undef,
		csv_allow_whitespace    => 1,
		csv_allow_quotes        => 1,
		RaiseError              => 1,
		PrintError              => 0,
		csv_tables => {
			output => {
				file => 'output.txt',
				col_names => [
					"title",
					"type",

lib/App/DuckPAN/Web.pm  view on Meta::CPAN

	if ($request->request_uri eq "/"){
		$response->content_type("text/html");
		$body = $self->page_root;
	}
	elsif (@path_parts && $path_parts[0] eq 'share') {
		my $share_dir;
		for (keys %{$self->_share_dir_hash}) {
			if ($request->path =~ m|^/$_/|g) {

				$share_dir = $_;
				# Get filename from path and url unescape
				my $filename = uri_unescape( pop @path_parts );
				# Trim path from left to right to find parent dir of filename
				# e.g /share/goodie/foo/foo_imgs/image.png -> "foo_imgs"
				my $remainder = $request->path_info;
				$remainder =~ s|$share_dir||;
				$remainder =~ s|$filename||;
				$remainder =~ s|//|/|;
				$remainder =~ s|^/\d{3,4}||;

				# if valid remainder exists, prepend to filename
				$filename = "$remainder$filename" if $remainder ne $filename;

lib/App/DuckPAN/Web.pm  view on Meta::CPAN

		my @results = ();
		my @calls_nrj = ();
		my @calls_nrc = ();
		my @calls_script = ();
		my %calls_template = ();
		my @calls_goodie;
		my @calls_fathead;
		my @ids;

		my $page = $self->page_spice;
		my $uri_encoded_query = uri_escape_utf8($query, "^A-Za-z");
		my $html_encoded_query = encode_entities($query);
		my $uri_encoded_ddh = quotemeta(uri_escape('duckduckhack-template-for-spice2', "^A-Za-z0-9"));
		$page =~ s/duckduckhack-template-for-spice2/$html_encoded_query/g;
		$page =~ s/$uri_encoded_ddh/$uri_encoded_query/g;

		# For debugging query replacement.
		#p($uri_encoded_ddh);
		#p($page);

		my $root = HTML::TreeBuilder->new;
		$root->parse($page);



( run in 0.624 second using v1.01-cache-2.11-cpan-c21f80fb71c )