To share, link to, and discuss bits of code that actually do DH-y things, or at least try to. And to ask questions along the lines of, "What's the best script-y way to <fill in short short task here>."

2015-10-23

2015-10-24

2015-10-25

2015-10-26

2015-10-27

2015-10-28

miriamposner
07:49:47 PM

Hey, soupy people, can I ask a Beautiful Soup question? What would you use to grab the paragraph beginning with “Cast:” on a page like this? I can’t figure out how to grab content by using the thing it starts with and I don’t seem to be Googling the right thing. http://silentera.com/PSFL/data/S/SymbolOfTheUnconquered1920.html


jay.varner
08:36:46 PM

@miriamposner: it’s been a while since i’ve used Beautiful Soup and I’m sure there is a better way, but here is a quick and dirty way for a one-off &gt;&gt;&gt; soup = BeautifulSoup(html_doc, 'html.parser') &gt;&gt;&gt; paragraphs = soup.find_all('p') &gt;&gt;&gt; for p in paragraphs: ... if "Cast" in str(p): ... print p ... &lt;p&gt;Cast: Iris Hall [Evon Mason], Walker Thompson [Hugh Van Allen], Lawrence Chenault, Jim Burris, Mattie Wilkes, E.G. Tatum, Leigh Whipper, James Burrough, George Catlin&lt;/p&gt;


miriamposner
08:41:17 PM

@jay.varner: Yes! That’s exactly what I needed. Thanks so much! I really appreciate it.


jay.varner
08:42:44 PM

glad i could help


2015-10-29

paregorios
01:02:54 PM

paregorios
01:05:10 PM

@sfsheath: testing github/gist integration. A little wonky but seems work ok.


sfsheath
05:44:17 PM

Wonky is good.


2015-11-02

mdlincoln
01:07:42 PM
Uploaded file: excel_utf8.sh

mdlincoln
01:08:30 PM
Uploaded file: rdf-json-csv.txt

2015-11-03

2015-11-04

2015-11-05

2015-11-06

2015-11-10

2015-11-12

mdlincoln
11:04:22 AM

has anyone ever written A Big Book Of Escaping Rules? Because I’d buy it.


fmcc
11:10:44 AM

@mdlincoln: For strings? Doesn’t it vary from language to language?


mdlincoln
11:11:12 AM

“Doesn’t it vary from language to language?” precisely


fmcc
11:17:08 AM

fmcc
11:19:21 AM

though really, what are you looking for from that kind of document?


fmcc
11:19:36 AM

mappings between escaping rules in various languages?


mdlincoln
11:20:34 AM

At the moment: trying to interleave a perl regex substitution within a makefile


mdlincoln
11:21:11 AM

I’ve fixed it (turns out you need to use double $$ when calling perl from make


mdlincoln
11:21:59 AM

just idly wondering how one might design some tool that helps map out escaping issues when calling different languages


fmcc
11:40:22 AM

fmcc
11:44:48 AM

doesn’t really seem that much use though, and I think it’s less about escaping rules and more about string handling quirks across languages


2015-11-13

scott.williams
11:20:27 AM

kind of unrelated but I found this infinitely useful when transitioning from java to python or when I’m just super lazy http://txt2re.com


2015-11-14