KnownSyntax has quit [Read error: Connection reset by peer]
<warlock_handler>
hello people
jcao219 has quit [Ping timeout: 256 seconds]
A5101 has quit [Ping timeout: 244 seconds]
Rodya_ has joined #ruby
jcao219 has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
minimalism has quit [Ping timeout: 268 seconds]
KnownSyntax has joined #ruby
Fichtenstein has quit [Ping timeout: 252 seconds]
gingray has joined #ruby
<havenwood>
warlock_handler: hi
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has quit [Ping timeout: 256 seconds]
<warlock_handler>
@havenwood - hey buddy.. hows it going..
ta_ has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
<warlock_handler>
havenwood: I am trying to make a small monitoring script in Ruby, I want to check if a particular JS is on a web page
<warlock_handler>
however I dont want to execute the JS
anuxivm has joined #ruby
nankyokusei has joined #ruby
<elomatreb>
warlock_handler: You mean embedded, right? As in not linked via src?
anuxivm has left #ruby [#ruby]
sid_fules has quit [Read error: Connection reset by peer]
<warlock_handler>
I know I could use stuff like NOKOGiri or similar web page scrapper or parser.. to get the page content
<warlock_handler>
elomatreb: no no no
hutch34 has joined #ruby
baweaver_away is now known as baweaver
<elomatreb>
Then I'm afraid I don't know what you mean
<warlock_handler>
elomatreb: Example, I have 3 webpages.. each have 3 different JS firing on them.. I want to simply monitor if the 3 pages have that JS file on them
<elomatreb>
You want to know if one of the other two pages contains a script from the first?
<warlock_handler>
the use case is, if I am advertising for 3 websites and I have a conversion pixel on 3 webpages.. however I dont have code level access on the websites
<warlock_handler>
hence if someone changes the page, I dont know if my conversion pixels are present or not
<elomatreb>
Is your script embedded inline or as an external file?
<warlock_handler>
a conversion pixel.. is a size 1x1 JS placed on a pixel in the page.. invisible to human eye
nankyokusei has quit [Ping timeout: 252 seconds]
<warlock_handler>
elomatreb: its external.. usually Google or other providers
<warlock_handler>
I can identify the pixels by their ids ..
<elomatreb>
I know what a tracking pixel is. If your script is external and the url is the same on all sites, you can use nokogiri and filter the script elements
chouhoulis has quit [Remote host closed the connection]
ResidentBiscuit has quit [Remote host closed the connection]
TheBrayn has quit [Quit: WeeChat 1.5]
<warlock_handler>
elomatreb: sorry i was just trying to explain it clearly
chouhoulis has joined #ruby
<warlock_handler>
elomatreb: ok cool.. but I dont want to execute the script, so if I am crawling it like once or 5 times a day, I dont want 1 or 5 conversions attributed to me
<elomatreb>
Nokogiri can't execute the script, it can only parse HTML
<warlock_handler>
elomatreb: awesomeness !!!
TheBrayn has joined #ruby
<warlock_handler>
I guess that should do it for me :D
<warlock_handler>
elomatreb: buddy have you used Google Tag Manager?
gingray has quit [Ping timeout: 245 seconds]
<elomatreb>
warlock_handler: Not really, no. Sorry
TheBrayn has quit [Client Quit]
nelsonsar has joined #ruby
TheBrayn has joined #ruby
hahuang65 has joined #ruby
<warlock_handler>
elomatreb: so I guess its got an iFrame in the <body> tag, and based on evens (like onclick) it dynamically executes pixels / JS i guess inside the iFrame in the body
<warlock_handler>
how would I handle that case?
<warlock_handler>
where the pixel is executed later, after the DOM is ready...
<warlock_handler>
and on a certain event
bturker has joined #ruby
arescorpio has joined #ruby
gtaylor1 has joined #ruby
<elomatreb>
warlock_handler: Mh, that would be slightly more difficult. You'd probably have to get the src of the iframe and parse it using Nokogiri
chouhoul_ has joined #ruby
<warlock_handler>
ohh
<elomatreb>
Maybe you should think about using an actual headless browser to do this, is the slight contamination of the data that bad?
jcao219 has quit [Ping timeout: 250 seconds]
<warlock_handler>
I dont understand that suggestion completely
<warlock_handler>
elomatreb: could you please dumb it down a little for me
charliesome has joined #ruby
<elomatreb>
warlock_handler: A headless browser is a browser that basically runs without rendering anything, and usually has a scripting interface. PhantomJS is one example
<warlock_handler>
ohhhhhhhh
bturker has quit [Ping timeout: 256 seconds]
<elomatreb>
Since it executes JS, it will build a complete DOM, but also probably contaminate your tracking data
chouhoulis has quit [Ping timeout: 256 seconds]
<warlock_handler>
got it.. like lynx ? CLI type?
<elomatreb>
lynx ignore javascript and has no DOM, so it's not what you need here
<warlock_handler>
ohhh thats what you mean when you say contaminate your data
<warlock_handler>
got it
<elomatreb>
It's only a few requests always coming from (probably) the same IP, can't you simply filter those out again?
<warlock_handler>
cant contaminate the data.. that defeats the purpose :(
dogweather has joined #ruby
<gtaylor1>
When I get a gem from rubygems.org, it is customary to expect it to build and install, correct? Am trying to understand why qpid_messaging does not install and does not have a .gemspec. ??
<elomatreb>
Then you'll probably have to get crafty with Nokogiri. You could try to get the src attribute from the iframe and parse the document at that url
<warlock_handler>
hmm let me try this... usually the conversion pixels cookie the browser.. if I dont accept their cookie.. they might not consider me as a valid conversion.. let me try that too
sid_fules has joined #ruby
maattdd has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
xrlk has quit [Ping timeout: 244 seconds]
raul782 has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
karapetyan has quit [Remote host closed the connection]
vikaton has joined #ruby
harai has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 258 seconds]
sarbs has joined #ruby
raul782 has quit [Ping timeout: 245 seconds]
montanonic has quit [Ping timeout: 260 seconds]
minimalism has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
sid_fules has quit [Read error: Connection reset by peer]
sid_fules has joined #ruby
xall has joined #ruby
xall has quit [Ping timeout: 244 seconds]
dogweather has quit [Remote host closed the connection]
hahuang65 has joined #ruby
jaguarmagenta has joined #ruby
jaguarma_ has joined #ruby
jaguarmagenta has quit [Ping timeout: 246 seconds]
nankyokusei has joined #ruby
jaguarma_ has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 246 seconds]
jaguarmagenta has joined #ruby
warlock_handler has quit [Ping timeout: 260 seconds]
Jackneill has quit [Remote host closed the connection]
solocshaw has quit [Ping timeout: 256 seconds]
Limix has quit [Quit: Limix]
sid_fules has quit [Read error: Connection reset by peer]
benlieb has joined #ruby
saneax-_-|AFK is now known as saneax
stan_man_can has joined #ruby
igniting has joined #ruby
<stan_man_can>
Hey all. I run a free API and I'm re-vamping the website. Would anyone mind writing some demo-code for how to use it in ruby? It's REALLY easy to use.
<havenwood>
stan_man_can: the Ruby community is rather stickler about two-space soft tabs and the block format is often preferred because it auto-closes (though in this case it's more just aesthetics)
<stan_man_can>
havenwood, good to know thanks
karapetyan has quit [Ping timeout: 265 seconds]
<stan_man_can>
I've been thinking about trying ruby/rails lately, we'll see if I can find a good project to use it for
d^sh has quit [Ping timeout: 248 seconds]
<havenwood>
stan_man_can: ah nice
<havenwood>
happy hacking!
<stan_man_can>
thanks :)
stan_man_can has left #ruby ["Leaving"]
ResidentBiscuit has joined #ruby
cdg has joined #ruby
<adam12>
What the heck is ,= and why have I never see it before today...
<al2o3-cr>
adam12: saves you from do arr[0]/first
<al2o3-cr>
if only the first element is needed
solocshaw has joined #ruby
ResidentBiscuit has quit [Ping timeout: 260 seconds]
<matthewd>
.. which yeah, is basically the same thing
conta has quit [Ping timeout: 260 seconds]
<gener1c>
String.prepend?
<matthewd>
Where String == the class you're decorating
<gener1c>
but why prepend
nankyokusei has joined #ruby
<herwin>
or you could use a proxy-object and method_missing
<gener1c>
method_missing is for missing methods
<gener1c>
not for existing ones
sid_fules has quit [Read error: Connection reset by peer]
sid_fules has joined #ruby
<matthewd>
gener1c: Because that's how you decorate a class?
sid_fules has quit [Remote host closed the connection]
<gener1c>
ah module prepend
<gener1c>
i was looking at String's api
nanoz has joined #ruby
nanoz has joined #ruby
nanoz has quit [Changing host]
<gener1c>
Class::prepend
sid_fules has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
<Mon_Ouie>
method_missing would work. You would define it on a proxy object that forwards all method calls to another object, not on the object itself.
<Mon_Ouie>
See e.g. the implementation of the Delegator class
Anonymoose2 has joined #ruby
jaguarmagenta has joined #ruby
reverberations has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
r3vDev has quit [Ping timeout: 258 seconds]
<gener1c>
so
<gener1c>
i would just define method missing on the delegator with the additional code and do a method call to the other object
<gener1c>
the issue with that would be calling a missing method and not getting an error right away
<Mon_Ouie>
You could check with #respond_to?
hightower2 has quit [Ping timeout: 246 seconds]
jaguarmagenta has quit [Ping timeout: 248 seconds]
ResidentBiscuit has quit [Ping timeout: 260 seconds]
william3 has quit [Remote host closed the connection]
<leitz>
The output code for this has the ":::" at the end, from lines 24,25.
<herwin>
item.sub!(/:+\z/, '')
<Mon_Ouie>
This code makes Bobby Tables sad
<herwin>
that's the only way to remove 0 or more : at the end afaik
<leitz>
The line_array.each starting in line 28 doesn't put the 'null" in, it prints nothing.
<herwin>
*only sensible way
<leitz>
The goal is the opposite; "null' values for sqlite so I can put the data in.
<leitz>
The issue I started with is that the last field, even if I changed it, included a newline.
vuoto has joined #ruby
<leitz>
Trying to put in "null" (line 30) was the goal, but it's notw working.
<leitz>
I'm assuming operator error, just not sure how to fix it.
<matthewd>
leitz: gist an example of what's going in, what you want out, and what's actually happening?
sid_fules has joined #ruby
<matthewd>
leitz: Also, you're not properly escaping these strings, so Very Bad Things could happen given malicious or even accidentally inconvenient input data
<leitz>
Mon_Ouie, so the array doesn't have anything after the first ":" in the final series?
r3vDev has quit [Ping timeout: 246 seconds]
<matthewd>
leitz: That seems like something you can confirm for yourself
<Mon_Ouie>
No, it's just that when there's nothing between two ':', you don't get an entry in the array
<matthewd>
.. at the end
<Mon_Ouie>
This may make more sense when you look at whitespace like: "foo bar baz", this splits into ["foo", "bar", "baz"]
<Mon_Ouie>
Oh, right, only at the end, whitespace is just special cased
<leitz>
matthewd, I did confirm it, just letting Mon_Ouie know.
<leitz>
One of those "hmm..." moments you share with friends.
nankyokusei has quit [Ping timeout: 265 seconds]
maattdd has quit [Ping timeout: 256 seconds]
<leitz>
So the solution is to ensure there's something between what would be empty fields.
<matthewd>
Isn't the solution to do the thing that Mon_Ouie showed made it do what you want? :/
<matthewd>
i.e., pass a second parameter to split
hightower3 has joined #ruby
* leitz
goes off to test.
charliesome has joined #ruby
charliesome has quit [Client Quit]
hightower2 has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
<leitz>
Yup.
maattdd has joined #ruby
hutch34 has joined #ruby
bturker has quit [Ping timeout: 256 seconds]
Kendos-Kenlen has joined #ruby
nanoz has quit [Quit: <3]
sid_fules has quit [Read error: Connection reset by peer]
hutch34 has quit [Ping timeout: 250 seconds]
symm- has joined #ruby
nankyokusei has joined #ruby
william3 has joined #ruby
conta has joined #ruby
tk__ has joined #ruby
william3 has quit [Remote host closed the connection]
<leitz>
So, with Mon_Ouie's suggestion the split issue has been fixed. With some time and coffee the "too many fields" issue has been resolved. Now back to matthewd's comment. Any good tutorials on better string escaping? i'm munging data from a known source in a different file, but better filtering is better.
william3 has joined #ruby
sdothum has joined #ruby
<matthewd>
The best advice is "don't" -- lean on a library that already knows what it's doing
nankyokusei has quit [Ping timeout: 244 seconds]
sid_fules has joined #ruby
ruby-Andrey has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
frankiee_ has quit [Ping timeout: 245 seconds]
harfangk has joined #ruby
william3 has quit [Ping timeout: 250 seconds]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
<leitz>
matthewd, the issue that I keep running into is that gems are often unsupported on old versions of Ruby, and that's what I have to work with. Unless it's in the standard library, I'm kinda hosed. Speaking of, lemme go look at the book.
frankiee_ has joined #ruby
william3 has joined #ruby
<herwin>
and why exactly are you running an old version of ruby?
platzhirsch has joined #ruby
cfec0b8d has joined #ruby
chouhoulis has joined #ruby
hightower2 has joined #ruby
terlar has joined #ruby
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
maattdd has quit [Ping timeout: 246 seconds]
william3 has quit [Remote host closed the connection]
nankyokusei has joined #ruby
hightower3 has quit [Ping timeout: 250 seconds]
montanonic has quit [Ping timeout: 256 seconds]
Janky has joined #ruby
Jank has quit [Read error: Connection reset by peer]
william3 has quit [Remote host closed the connection]
careta has quit [Ping timeout: 246 seconds]
nadir has quit [Quit: Connection closed for inactivity]
nowhere_man has joined #ruby
tomphp has joined #ruby
<yorickpeterse>
chrisseaton: how does Truffle handle objects stored in the GC's remembered set? Does it just do whatever the heck the JVM does?
sepp2k has joined #ruby
nankyokusei has joined #ruby
<yorickpeterse>
chrisseaton: e.g. does it just keep track of mature -> young pointers until they're no longer in use?
<yorickpeterse>
chrisseaton: for this GC I'm working on I'm just promoting those young pointers right away, but I'm curious what other VMs do. Sadly I can't really find that many details on the JVM & friends
platzhirsch has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nankyokusei has quit [Ping timeout: 252 seconds]
william3 has joined #ruby
Devalo has joined #ruby
r3vDev has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
yeticry has joined #ruby
vuoto has quit [Remote host closed the connection]
william3 has quit [Remote host closed the connection]
nankyokusei has joined #ruby
jaguarmagenta has joined #ruby
william3 has joined #ruby
yeticry has quit [Remote host closed the connection]
william3 has quit [Remote host closed the connection]
sid_fules has joined #ruby
yeticry has joined #ruby
rippa has joined #ruby
nankyokusei has quit [Ping timeout: 268 seconds]
symm- has quit [Ping timeout: 265 seconds]
jaguarmagenta has quit [Ping timeout: 248 seconds]
hanmac has quit [Quit: Leaving.]
mBailey_j has joined #ruby
muelleme has quit [Ping timeout: 268 seconds]
nankyokusei has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
cibs has quit [Ping timeout: 268 seconds]
leitz has quit [Quit: Nappy time]
cibs has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
minimalism has joined #ruby
bturker has joined #ruby
Janky has quit [Quit: Leaving]
Janky has joined #ruby
Rodya_ has quit [Read error: Connection reset by peer]
Rodya_ has joined #ruby
Janky is now known as JankyDoodle
raul782 has joined #ruby
william3 has joined #ruby
nankyokusei has joined #ruby
JankyDoodle has quit [Read error: Connection reset by peer]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 245 seconds]
raul782 has quit [Ping timeout: 250 seconds]
zapata has quit [Quit: WeeChat 1.6]
kimegede has joined #ruby
minimalism has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
shinnya has joined #ruby
tomphp has joined #ruby
nankyokusei has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
cloud has quit [Quit: Goodbye!]
anuxivm has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 248 seconds]
anuxivm has joined #ruby
anuxivm has quit [Max SendQ exceeded]
nankyokusei has joined #ruby
tk__ has quit [Quit: ばいばい]
zapata has joined #ruby
aef has quit [Ping timeout: 256 seconds]
nankyokusei has quit [Ping timeout: 256 seconds]
kimegede has quit [Quit: Leaving...]
sid_fules has joined #ruby
symm- has joined #ruby
nankyokusei has joined #ruby
tau has joined #ruby
william3 has quit [Remote host closed the connection]
BigDawg has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Ping timeout: 246 seconds]
Tempesta has quit [Quit: See ya!]
zeroDi has joined #ruby
zeroDi has quit [Read error: Connection reset by peer]
zeroDi has joined #ruby
Devalo has quit [Remote host closed the connection]
bmurt has joined #ruby
william3 has joined #ruby
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
BigDawg has quit [Remote host closed the connection]
<droids___>
I'm able to override (in this wrap around) Kernel.system by declaring "module Kernel" and then re-defining the "system" method. However I'm not able to do the same for Open3. My methods never get called. Any ideas on why this is happening and how can I fix it?
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jaguarmagenta has quit [Remote host closed the connection]
domgetter has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 246 seconds]
zacts has quit [Ping timeout: 245 seconds]
bmurt has joined #ruby
giraffe has joined #ruby
tpendragon has joined #ruby
<al2o3-cr>
droids___: what are you trying to do?
conta has joined #ruby
jaguarmagenta has joined #ruby
symm- has joined #ruby
r3vDev has quit [Ping timeout: 258 seconds]
nelsonsar has joined #ruby
<droids___>
al2o3-cr: I'm using TracePoint to log events. But when it comes to Kernel.system or Open3.capture3 I get no visibility on what gets efectively executed. So I'm wrapping those methods so I can log which command is executed. I can do it for Kernel.system and it works fine but not for Open3.
<droids___>
and by wrapper I mean re-declaring the module and re-defining the method