The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-01-19

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:37 tchaves joined #mojo
00:37 tchaves1 joined #mojo
00:52 cpan_mojo Mojolicious-Plugin-Web-Auth-0.13 by HAYAJO https://metacpan.org/release/HAYAJO/Mojolicious-Plugin-Web-Auth-0.13
00:55 aborazmeh joined #mojo
01:09 zivester joined #mojo
01:45 bit_shifter joined #mojo
01:52 bit_shifter Trying to scrape Comcast's amazing site for current usage and allotment:  https://customer.xfinity.com/MyServices/Internet/UsageMeter.  The page loads some other js files and performs ajax requests to other pages to populate the data usage portion, so it takes about 10 seconds to fully load said data.  What's the best way to try to scrape it with Mojo's UA?
01:53 pink_mist by recreating the requests that the JS makes
01:53 Grinnz Mojo::Phantom might be useful, but its mostly for testing
01:54 Grinnz for scraping usually emulating what the JS requests is good enough
01:55 bit_shifter It loads several js files, which I've skimmed through for keywords, etc., and this is the closest I can see: http://sprunge.us/WDHN
01:56 bit_shifter When I load that url: https://customer.xfinity.com/Secure/UsageMeterAjaxPage.aspx directly, I get a blank page.  Can't figure out what else it needs to return the real data.
01:58 pink_mist you could just use some plugin for your browser that shows you what requests are being made
01:58 pink_mist and as I said, recreate those
01:58 pink_mist firebug for firefox is a good option
01:59 pink_mist if you're having trouble reading the JS tha tis
01:59 pink_mist *that is
01:59 bit_shifter Any thoughts on Chromium extensions?
01:59 bit_shifter Yeah... the js is convoluted
01:59 pink_mist I've never used chromium, so no
02:00 Grinnz chrome/chromium dev tools are basically the same as firebug
02:00 Grinnz F11
02:00 bit_shifter F12? :)
02:00 Grinnz yeah, one of those :P
02:05 bit_shifter If the js calls it, will it show up as an xhr in Chrome's dev tools "Network" tab?  I've been poking around in there already and I just can't find anything related.
02:20 Grinnz xhr is requests by javascript, yes
02:20 Grinnz it will only show the requests that happened while the window is open though
02:42 sugar joined #mojo
03:19 sugar joined #mojo
03:35 lluad_ joined #mojo
03:39 disputin joined #mojo
03:42 haarg firebug is dead.  firefox's built in dev tools do everything it used to.
03:53 noganex_ joined #mojo
03:59 disputin joined #mojo
04:20 sugar joined #mojo
04:29 disputin joined #mojo
04:39 disputin joined #mojo
05:01 prajith joined #mojo
05:04 dboehmer joined #mojo
05:13 bpmedley joined #mojo
05:32 inokenty-w joined #mojo
06:51 dod joined #mojo
06:58 dod joined #mojo
07:11 aborazmeh joined #mojo
07:28 marty joined #mojo
07:50 AndrewIsh joined #mojo
07:53 janl joined #mojo
08:06 Petru joined #mojo
08:07 dod joined #mojo
08:52 rshadow joined #mojo
08:59 ashimema I think I'm getting totally confused by `under`.. I've somehow managed to create a deep recursion :(
09:00 ashimema Anyone around that might be able to guide me where to start debugging this.. I'm completely at a lose of where to start :(
09:00 rshadow joined #mojo
09:03 perlpilot joined #mojo
09:03 ashimema https://ssl.thorsen.pm/paste/974533a14459 the deep recursion warnings i'm getting.. and what I 'think' is the relevant code from my app
09:07 kes joined #mojo
09:09 ashimema hmmm
09:09 ashimema think i'm totally misunderstanding 'dispatch chains'.. returning 1/0 as aposed to calling continue seems to fix my recursion
09:10 ashimema anyone able to point me at any relevant dispatch chain description/documentation.. think i may have a fairly fundamental misunderstanding :(
09:25 bpmedley ashimema : https://gist.github.com/brianmed/329600b608d5cd84808034cac0532153
09:25 bpmedley ashimema : See the definition at line 17 and usage at 34?
09:31 sugar joined #mojo
09:53 ashimema thanks bpmedley... changing from continue in the controllers to returning true/false did indeed fix the issue for me
09:54 ashimema I think I misread the whole 'breaking dispatch chains' and 'continue' documentation first time around
09:54 * ashimema is re-reading some docs now :)
10:42 kes joined #mojo
10:54 gregf_ joined #mojo
10:54 sri recently i've been using Mojo::Util::getopt a lot with Mojolicious::Command::extract_usage
10:54 sri combining them is a little odd at the moment
10:55 sri https://github.com/kraih/mojo/blob/master/script/hypnotoad
10:55 sri feels like there should be a Mojo::Util::extract_usage
10:56 sri to untangle the Mojo/Mojolicious layers
11:14 Vandal joined #mojo
11:39 stryx` joined #mojo
11:49 sugar joined #mojo
12:02 sri btw. be careful with sherlock season 4 episode 3... ever since i saw it i can't stop listening to i want to break free from queen :)
12:10 nic thanks for the heads-up
12:19 Jonis sri: good tune!
12:39 pink_mist I wouldn't mind listening to that
12:40 sugar joined #mojo
13:12 jberger Speaking of music from the small screen
13:13 jberger I just watched a documentary about Back to the Future
13:13 jberger And the background music was great
13:14 jberger https://youtu.be/zQj6LxJTEQY
13:14 jberger Listen to that
13:44 sugar joined #mojo
13:53 Petru joined #mojo
14:10 gizmomathboy joined #mojo
14:12 tchaves joined #mojo
14:13 tchaves1 joined #mojo
14:41 tchaves joined #mojo
14:42 bwf joined #mojo
14:50 Janos joined #mojo
14:51 rshadow joined #mojo
15:24 Pyritic joined #mojo
15:31 gryphon joined #mojo
15:53 sh14 joined #mojo
15:56 dikim joined #mojo
16:00 zivester joined #mojo
16:11 * sri kind of wants to get a better standing desk... but really doesn't want to rewire everything :S
16:11 Petru joined #mojo
16:15 jberger did I mention I got the ikea one?
16:15 jberger I like it well enough
16:15 jberger I bought a cable try that attaches underneath
16:16 sri really? i looked at those, and they seemed a bit wobbly
16:16 jberger not too bad
16:16 jberger when it is all the way up it might be a little woobly but not enough to worry that anything is going to fall over
16:17 sri did get two SIGNUMs though for my cable management
16:17 jberger yeah, that's exactly what I have
16:18 jberger the only thing I'm thinking now is that I almost wish I bought the wider table
16:18 disputin joined #mojo
16:18 sri they are great, even leave enough room for a dell monitor arm
16:18 jberger three monitors across and there are monitors all the way across the desk
16:21 sri no way i could fit 3 monitors on this one
16:25 jberger I only have one large one, then one old/small one and my laptop monitor open
16:25 jberger the large one in the middle
16:29 sri ah, i have only one large monitor and two laptops on the sides and speakers in between
16:31 jberger I had to put my speakers behind the monitors
16:33 cromedome jberger: which one did you get? I have been meaning to try a standing desk.
16:33 cromedome I will be over by your Ikea tomorrow.
16:41 perlpilot (standing desks)++
16:41 sugar joined #mojo
16:41 perlpilot Though I still sit at them more than I should, having the option to stand is nice
16:43 jberger cromedome: http://www.ikea.com/us/en/catalog/products/S49084965/
16:43 jberger though you can get a wider top for a little more and maybe I should have
16:43 marty I recently bought the Autonomous.ai standing desks for two of our employees.  They seem to really like them.
16:44 jberger http://www.ikea.com/us/en/catalog/products/S29084966/
16:44 jberger the legs are the exact same though, so I can go buy the other top if I end up wanting it
16:45 cromedome Where did you get your cable management from?
16:45 jberger marty: wow, that's the cheapest I've seen a powered one
16:45 jberger cromedome: ikea too
16:45 jberger the thing sri mentioned
16:46 pink_mist signum
16:46 jberger works decently well
16:47 jberger just a tray but with places to bend the cords to stop them moving
16:51 sri wow, that is really cheap for a standing  desk with motor
16:52 sri cable tray is great when combined with velcro
16:53 sri this stuff is great https://www.amazon.de/tesa-Kabelbinder-Klett-OFF-Rolle/dp/B001JYP0IS/
16:54 * ashimema built his own standing desk probably a couple of years back now
16:54 * ashimema will never look back.. :)
16:55 * ashimema works from home though.. so a permanent home build was viable ;)
16:55 cromedome jberger sri: thanks :)
16:58 lluad joined #mojo
16:59 perlpilot ashimema: Have you see woodgears.ca?  I think that guy built a desk that could function as a normal desk or a standing desk.  I've wanted to do that at home.
16:59 perlpilot yeah ... https://woodgears.ca/laptop_table/knock_down.html
17:09 marty I was extremely surprised by the build quality.  the thing has a lot of steel in it.  We got the bamboo tops.  The motorized motion is extremely smooth.  We opted for the $50 upgrade and got dual motors.
17:10 inbioz joined #mojo
17:13 sri grrr... i'm still humming that queen song
17:15 * sri right now https://www.youtube.com/watch?v=JV0-tNEew6Q
17:15 sri (no spoiler)
17:24 disputin joined #mojo
17:26 disputin1 joined #mojo
17:31 PryMar56 joined #mojo
17:32 sri proposal for extract_usage https://gist.github.com/anonymous/3400478bbb1c38b5dbef11b5281a78d5
17:33 sri advantage is better tests and better looking scripts
17:33 sri downside, one new line of code
17:34 dantti_laptop joined #mojo
17:35 sri or one less line of code if you count scripts ;p
17:39 sri i'd like for our scripts to look like this https://gist.github.com/anonymous/785f78cf95e0040305bcc47648f2829d
17:39 disputin joined #mojo
17:44 good_news_everyon joined #mojo
17:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMytN
17:44 good_news_everyon mojo/master 193a2c4 Sebastian Riedel: add extract_usage function to Mojo::Util
17:44 good_news_everyon left #mojo
17:48 good_news_everyon joined #mojo
17:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMyqE
17:48 good_news_everyon mojo/master 0f67dbd Sebastian Riedel: leave some space
17:48 good_news_everyon left #mojo
17:50 disputin1 joined #mojo
17:50 sri i'm prolly the only one who cares about little aesthetic details like that :)
17:50 sri but i like how the script looks now https://github.com/kraih/mojo/blob/master/script/hypnotoad
17:51 sri a very mojo style
18:03 good_news_everyon joined #mojo
18:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMyYi
18:03 good_news_everyon mojo/master b2cfdc9 Sebastian Riedel: just default to @ARGV
18:03 good_news_everyon left #mojo
18:05 sri ohoh, i see a holy war coming up at $work :) https://github.com/os-autoinst/os-autoinst/pull/702#discussion_r96857958
18:08 sword_smith joined #mojo
18:09 sword_smith_ joined #mojo
18:22 Grinnz #team@_
18:22 sri :O
18:58 tchaves joined #mojo
18:59 Seth joined #mojo
18:59 tchaves1 joined #mojo
18:59 marty_ joined #mojo
19:11 jberger sri++ # extract_usage
19:19 Seth joined #mojo
19:42 Petru joined #mojo
20:06 jberger apropos of nothing: https://www.sunshineapp.com/blog/content/images/2016/07/what-if-I-told-you.jpg
20:16 good_news_everyon joined #mojo
20:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMyaA
20:16 good_news_everyon mojo/master 3e8c6ae Sebastian Riedel: an arrayref might be the second argument when using @ARGV
20:16 good_news_everyon left #mojo
20:20 good_news_everyon joined #mojo
20:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vMyVa
20:20 good_news_everyon mojo/master 21aab88 Sebastian Riedel: just use one line
20:20 good_news_everyon left #mojo
20:20 * Grinnz has to read https://github.com/kraih/mojo/commit/3e8c6aef016b9edc2611dba5751f790f3d2e376e#diff-f794a3437aab8543fdc53904e356a38fR151 a few times
20:21 sri :)
20:22 sri bit of a weird problem
20:22 genio that one breaks my brain
20:28 sri the two values in the list are the defaults, the map checks if there are arrayrefs in @_ that could replace them
20:30 sri it works because the args can be "foo => @values", "\@args, foo => \@values" and "\@args, \@opts, foo => \@values"
20:30 sri oops
20:31 sri "'foo=s' => \@values", "\@array, 'foo=s' => \@values" and "\@array, \@opts, 'foo=s' => \@values"
20:31 sri more like that
20:33 sri http://mojolicious.org/perldoc/Mojo/Util#getopt
20:33 pink_mist I'd request you put that stuff in a comment, because it is less than obvious by reading the code :P
20:36 simbabque is there a built-in way to disable the cache in mojolicious::lite? http://stackoverflow.com/q/41750243/1331451
20:36 pink_mist what cache?
20:36 simbabque template cache
20:36 pink_mist use morbo?
20:37 simbabque not an option as far as I understand
20:37 simbabque check the SO question
20:37 simbabque the guy wants to disable the template cache completely
20:37 Grinnz aha, i was missing that an "options" arrayref could be passed
20:37 simbabque my little hack works, but I bet there is a better way
20:39 Grinnz looks like a decent way to me. it could be packaged as a plugin, even
20:39 Grinnz also, you can set that cache in app startup, rather than every request
20:40 Grinnz alternatively, the renderer could have a config option to not use the cache, but that requires changes to the renderer :)
20:41 Grinnz by the renderer, i mean Mojolicious::Plugin::EPRenderer
20:41 simbabque Grinnz: yeah, that's what I said in the answer too, but I didn't want to look it up. I hardly every use Mojo
20:41 simbabque I thought it might have that option
20:41 simbabque looks like I was wrong
20:41 simbabque :)
20:42 simbabque I know too little about the plugin architecture of mojo to turn it into a no-template-cache plugin
20:42 simbabque on the other hand I have two more hours of train ride and german ICEs now have internet :D
20:43 Grinnz i could whip one up in a few minutes, though writing tests would take longer
20:44 Grinnz although, there's another option
20:44 Grinnz https://metacpan.org/pod/Mojo::Cache#max_keys
20:44 Grinnz app->renderer->cache->max_keys(0);
20:45 simbabque ah
20:45 simbabque that makes sense too
20:45 Grinnz it's not really relevant to the question, but i'm extremely confused by this sentence in the question: "Perl CGI is configured via mod_perl."
20:46 Grinnz a plain CGI script and mod_perl are two very different constructs
20:46 simbabque they are
20:46 simbabque but iirc it's just _loading_ th e stuff once
20:46 simbabque but it's running it every time
20:46 Grinnz that would not be a plain CGI script
20:46 simbabque n
20:46 simbabque no
20:47 simbabque I think it does compile time once, and run time with every req
20:47 simbabque like the entire app runtime
20:47 simbabque so it would install route handlers with every request
20:47 simbabque but I could be wrong
20:47 Grinnz anyway, the usual method is to restart the application server when you make changes to the code or templates, this is simple with the standard hypnotoad deployment
20:47 Grinnz with this, it sounds like that would be restarting apache
20:48 simbabque I also think the question is talking about the development server... he says he's working on his JS frontend, some of which is in the template file
20:48 Grinnz if one is making arbitrary template changes in production, i don't know what else to say :P
20:48 Grinnz yes, then that's what morbo is for
20:48 simbabque that one I know, it's fun
20:48 simbabque it just works
20:49 simbabque but as I said, I don't usually use mojo, I'm just bored :)
20:49 simbabque you should post an answer with the max_keys
20:49 simbabque it's better than my solution
20:49 Grinnz i don't have karma or whatever to post on stack overflow
20:50 simbabque you need 1
20:50 Grinnz i would definitely mention morbo as an answer to his first question "How can I make the app notice template changes reliably?"
20:51 simbabque you just need an account to write an answer, no points required
20:51 Grinnz oh alright
20:52 simbabque why does https://metacpan.org/pod/Mojolicious::Plugin not explain how to make a plugin?
20:52 Grinnz because https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Adding-a-plugin-to-your-application does
20:52 jberger Grinnz: you beat me
20:53 simbabque maybe that should be linked, so I can be lazy and not google it
20:57 sri "i'm lazy, put a keyword index in every page!"
20:58 pink_mist well, I wouldn't say it was farfetched for a link to how to write plugins to be in Mojolicious::Plugin
20:59 jberger simbabque: Guides are where you go to learn X; class documentation is reference
20:59 simbabque it is the base class after all
21:01 Grinnz "You need at least 10 reputation to post more than 2 links." rofl
21:01 Grinnz how the fuck am i supposed to answer properly
21:02 Grinnz there, got rid of a link
21:03 Pyritic joined #mojo
21:09 simbabque Grinnz: you could be a bad spammer ;)
21:10 Grinnz "fighting spam" should probably be added to the Two Hard Problems in Programming
21:10 simbabque yes
21:10 simbabque you now have 11 rep
21:10 simbabque :)
21:10 simbabque I need to change trains
21:11 simbabque be back later with questions on how to do tests for a plugin ;)
21:15 jberger 21
21:16 Grinnz yay
21:16 Grinnz i'm probably not a robot
21:17 sri nobody's perfect
21:17 coolo joined #mojo
21:17 genio Grinnz: http://www.reactiongifs.com/r/2013/06/I-dont-believe-you.gif
21:19 jberger hahaha
21:30 simbabque you have to love deutsche bahn, train is still in the station, police is coming in
21:32 pink_mist what did you do?!
21:32 simbabque used too much wifi probably
22:18 disputin joined #mojo
23:36 zivester joined #mojo
23:41 sugar joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary