From madcityzen at gmail.com Fri Dec 4 07:47:12 2015 From: madcityzen at gmail.com (Doug Bell) Date: Fri, 4 Dec 2015 09:47:12 -0600 Subject: [Chicago-talk] Meeting December 10 - Testing PSGI With Test::Mojo and Stupid Websocket Tricks - New Venu Message-ID: <3FDDA9D7-F8AF-4F81-87A2-AB2B199BBC2E@gmail.com> We've got a couple short talks scheduled for this month, and we have a new venue, generously provided by ServerCentral (http://www.servercentral.com). Joel Berger (http://metacpan.org/author/JBERGER) is going to give a talk on testing any PSGI application with Test::Mojo, Mojolicious's excellent web testing library. And, Doug Bell (http://metacpan.org/author/PREACTION) is going to give a talk on some simple websocket tricks with Mercury (a WebSocket message broker), Mojolicious and Mojo::UserAgent. Due to the holidays, our meeting will be on December 10. RSVP on the Chicago.PM Meetup: http://www.meetup.com/ChicagoPM/events/226879320/ Doug Bell madcityzen at gmail.com From JJacobus at PonyX.com Wed Dec 23 09:43:15 2015 From: JJacobus at PonyX.com (Jim Jacobus) Date: Wed, 23 Dec 2015 11:43:15 -0600 Subject: [Chicago-talk] Generate a 404 error from a perl script Message-ID: <20151223180408.2998211E066@xx1.develooper.com> How to I create a 404 error from a cgi-bin script. I know the message needs to be before any other text, but I'm having trouble with this. Background: I have a script that is indexed by all the search engines. It has a parameter which is a item number (e.g. http://example.com/cgi-bin/script.pl?nnnnnn ) where nnnnnn is a item number. The script figures out if this is a current item number and forwards it to an HTML page if it is. If it isn't a current item number, I create a page that is a similar product. The item numbers (nnnnnn) are added and deleted all the time. I want the search engines to stop indexing expired items, so I want to create a 404 error but still produce a page for the end user. I thought there was a simple print statement I needed to write out, but I'm having trouble figuring out what it is. Thanks in advance. Jim From don at drakeconsulting.com Wed Dec 23 10:51:36 2015 From: don at drakeconsulting.com (Don Drake) Date: Wed, 23 Dec 2015 12:51:36 -0600 Subject: [Chicago-talk] Generate a 404 error from a perl script In-Reply-To: <20151223180408.2998211E066@xx1.develooper.com> References: <20151223180408.2998211E066@xx1.develooper.com> Message-ID: Take a look at this example: http://www.oreilly.com/openbook/cgi/ch03_07.html #!/usr/local/bin/perl $remote_host = $ENV{'REMOTE_HOST'}; print "Content-type: text/plain", "\n"; if ($remote_host eq "bu.edu") { print "Status: 200 OK", "\n\n"; print "Great! You are from Boston University!", "\n"; } else { print "Status: 400 Bad Request", "\n\n"; print "Sorry! You need to access this from Boston University!", "\n"; } exit (0); -Don -- Don Drake www.drakeconsulting.com www.maillaunder.com 312-560-1574 800-733-2143 > On Dec 23, 2015, at 11:43 AM, Jim Jacobus wrote: > > > How to I create a 404 error from a cgi-bin script. I know the message needs to be before any other text, but I'm having trouble with this. > Background: I have a script that is indexed by all the search engines. It has a parameter which is a item number (e.g. http://example.com/cgi-bin/script.pl?nnnnnn ) where nnnnnn is a item number. The script figures out if this is a current item number and forwards it to an HTML page if it is. If it isn't a current item number, I create a page that is a similar product. The item numbers (nnnnnn) are added and deleted all the time. I want the search engines to stop indexing expired items, so I want to create a 404 error but still produce a page for the end user. > > I thought there was a simple print statement I needed to write out, but I'm having trouble figuring out what it is. > Thanks in advance. > Jim > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From JJacobus at PonyX.com Wed Dec 23 11:18:24 2015 From: JJacobus at PonyX.com (Jim Jacobus) Date: Wed, 23 Dec 2015 13:18:24 -0600 Subject: [Chicago-talk] Generate a 404 error from a perl script In-Reply-To: References: <20151223180408.2998211E066@xx1.develooper.com> Message-ID: <20151223191837.EB5181201F9@xx1.develooper.com> Well, that was easy. Now I feel dumb. Thank you. At 12:51 PM 12/23/2015, Don Drake wrote: >Take a look at this example: > >http://www.oreilly.com/openbook/cgi/ch03_07.html > > >#!/usr/local/bin/perl >$remote_host = $ENV{'REMOTE_HOST'}; >print "Content-type: text/plain", "\n"; >if ($remote_host eq "bu.edu") { > print "Status: 200 OK", "\n\n"; > print "Great! You are from Boston University!", "\n"; >} else { > print "Status: 400 Bad Request", "\n\n"; > print "Sorry! You need to access this from Boston University!", "\n"; >} >exit (0); > > >-Don > >-- >Don Drakewww.drakeconsulting.com >www.maillaunder.com >312-560-1574 >800-733-2143 > >>On Dec 23, 2015, at 11:43 AM, Jim Jacobus >><JJacobus at PonyX.com> wrote: >> >> >>How to I create a 404 error from a cgi-bin script. I know the >>message needs to be before any other text, but I'm having trouble with this. >>Background: I have a script that is indexed by all the search >>engines. It has a parameter which is a item number (e.g. >>http://example.com/cgi-bin/script.pl?nnnnnn >>) where nnnnnn is a item number. The script figures out if this is >>a current item number and forwards it to an HTML page if it is. If >>it isn't a current item number, I create a page that is a similar >>product. The item numbers (nnnnnn) are added and deleted all the >>time. I want the search engines to stop indexing expired items, so >>I want to create a 404 error but still produce a page for the end user. >> >>I thought there was a simple print statement I needed to write out, >>but I'm having trouble figuring out what it is. >>Thanks in advance. >>Jim >> >>_______________________________________________ >>Chicago-talk mailing list >>Chicago-talk at pm.org >>http://mail.pm.org/mailman/listinfo/chicago-talk > >_______________________________________________ >Chicago-talk mailing list >Chicago-talk at pm.org >http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard at rushlogistics.com Mon Dec 28 12:13:07 2015 From: richard at rushlogistics.com (richard at rushlogistics.com) Date: Mon, 28 Dec 2015 14:13:07 -0600 Subject: [Chicago-talk] LWP Error Message-ID: <20151228141307.tpoxlln3k8o08ssg@hostingemail.xo.com> I am having trouble making calls to a REST application with LWP despite having my IP whitelisted by the service and was wondering if anyone might know what I am doing wrong. my $ua?? = LWP::UserAgent->new; my $data = {? ????????????? source => 'MYSOURCE',? ????????????? userid => 'MYUSERID,? ????????????? password => 'mypassword', ? ? ?? ????? scope => 'my scope', }; use JSON::PP; my $js = JSON::PP->new; $js->canonical(1); my $json_string = $js->encode($data); #print "Jason String: " . $json_string . "\n"; $ua->default_header("Content-Type" => "application/json"); my $response = $ua->post("https://api-sandbox.networkforgood.org/access/rest/token", Content => $json_string); print $response->as_string; I have verified that $json_string is correctly serialized. Here is the response I get back: HTTP/1.1 400 Bad Request Cache-Control: private Date: Mon, 28 Dec 2015 19:48:59 GMT Server: Microsoft-IIS/8.0 Content-Length: 1647 Content-Type: text/html Client-Date: Mon, 28 Dec 2015 19:48:54 GMT Client-Peer: 68.64.143.14:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3 Client-SSL-Cert-Subject: /C=US/ST=District Of Columbia/L=Washington/O=Network For Good/OU=Network For Good Web Sites/CN=*.networkforgood.org Client-SSL-Cipher: ECDHE-RSA-AES128-SHA256 Client-SSL-Socket-Class: IO::Socket::SSL Set-Cookie: ASP.NET_SessionId=4aaivqosmxn1bxdsszvvsqxm; path=/; HttpOnly Set-Cookie: NfgPrimaryKey=56e913bc-823b-4cfe-9968-98575631b6e7; expires=Tue, 27-Dec-2016 19:48:59 GMT; path=/ Title: Request Error X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET ? ??? Request Error ??? ? ? ???
?????

Request Error

?????

The server encountered an error processing the request. See server logs for more details.

???
? From lembark at wrkhors.com Wed Dec 30 08:51:52 2015 From: lembark at wrkhors.com (Steven Lembark) Date: Wed, 30 Dec 2015 10:51:52 -0600 Subject: [Chicago-talk] LWP Error In-Reply-To: <20151228141307.tpoxlln3k8o08ssg@hostingemail.xo.com> References: <20151228141307.tpoxlln3k8o08ssg@hostingemail.xo.com> Message-ID: <20151230105152.52901eb9@cannibal> On Mon, 28 Dec 2015 14:13:07 -0600 richard at rushlogistics.com wrote: > ? > ???
> ?????

Request Error

> ?????

The server encountered an error processing the request. See server logs for more details.

> ???
> ? 404 == Not Found == they cannot map your path onto anything they handle. Odd that you got the server error, which is normally in the 500's. I love their remedy: Go check the logs. I'd call/email the support line at whomever you are dealing with and ask them: if you have verified that the host exists (e.g., with a browser or telnet to port 80 on the server) and are following their rules for the path then it's on them to tell you what is wrong with the request. -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark at wrkhors.com +1 888 359 3508 From richard at rushlogistics.com Wed Dec 30 09:32:50 2015 From: richard at rushlogistics.com (richard at rushlogistics.com) Date: Wed, 30 Dec 2015 11:32:50 -0600 Subject: [Chicago-talk] LWP Error In-Reply-To: <20151230105152.52901eb9@cannibal> References: <20151228141307.tpoxlln3k8o08ssg@hostingemail.xo.com> <20151230105152.52901eb9@cannibal> Message-ID: <20151230113250.z03s6na5cgkcssg4@hostingemail.xo.com> Actually, it appears to be an LWP issue. Not sure if it's a bug or a feature but I tried it this way and it worked: ? my $req = HTTP::Request->new( 'POST', $url ); $req->content( $json_string ); my $response = $ua->request( $req ); ? However, this does not: my $response = $ua->post("https://api-sandbox.networkforgood.org/access/rest/token", Content => $json_string); On Wed, 30 Dec 2015 10:51:52 -0600, Steven Lembark wrote: On Mon, 28 Dec 2015 14:13:07 -0600 richard at rushlogistics.com wrote: > ? ??? ????? Request Error > ????? The server encountered an error processing the request. See server logs for more details. > ??? ? 404 == Not Found == they cannot map your path onto anything they handle. Odd that you got the server error, which is normally in the 500's. I love their remedy: Go check the logs. I'd call/email the support line at whomever you are dealing with and ask them: if you have verified that the host exists (e.g., with a browser or telnet to port 80 on the server) and are following their rules for the path then it's on them to tell you what is wrong with the request. -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark at wrkhors.com +1 888 359 3508 _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at petdance.com Wed Dec 30 10:30:51 2015 From: andy at petdance.com (Andy Lester) Date: Wed, 30 Dec 2015 12:30:51 -0600 Subject: [Chicago-talk] Looking for a Perl 6 talk Message-ID: <50039F39-ECFA-4F39-97A9-B07B12623263@petdance.com> Wayne Schneideman from Uniforum Chicago (http://uniforum.chi.il.us/ ) emailed me asking if I would like to do a talk on Perl 6. Since I only tangentially follow Perl 6, I told him I would not be a good person to do this, but that I would post to the Perl Mongers mailing list and see if anyone there is interested. His original email to me says: ?Would you be interested in doing a presentation before UniForum Chicago on Perl 6? Maybe going over why we should care, and what is different between Perl 5 and Perl 6... can perl 5 code run on Perl 6 etc.? If you can help out, please email him at wayne.schneidman at gmail.com Thanks, Andy -- Andy Lester => www.petdance.com -------------- next part -------------- An HTML attachment was scrubbed... URL: