DISQUS

bobthecow: bobthecow - In one fell swoop

  • Name · 3 months ago
    your code escapes the box... leaking to the right a little.
  • justin hileman · 3 months ago
    I might have fixed it. Wanna check?
  • Name · 3 months ago
    yeah, now it does overflow.
  • Name · 3 months ago
    (properly)
  • Name · 3 months ago
    except only once I refresh... what?
  • justin hileman · 3 months ago
    I'm not sure what that's about, but I tweaked things a bit more... It should be happier now.
  • tucker · 3 months ago
    perhaps you could replace the two invocations of grep with one sed script:

    sed -n 's/.*\.tumblr\.com\/post\/\(([0-9]+)\).*/\1/gp' > tumblr_ids.txt

    looks ugly but might be more efficient...

    However, I much approve of the one line goodness.
  • justin hileman · 3 months ago
    I thought about busting out sed, really I did. I'm just quite a bit slower with sed. And the gains would be negligible, since the vast majority of the execution time is in the wget chunk, not the parsing. So my time won, since it took me < 10 seconds to write the grep chain :)
  • tucker · 3 months ago
    "gains would be negligible" <- Relative! I just couldn't look at the two greps and say Okiee. So what if I played with sed and sed docs for a half-hour to get that line just right? I dusted off my sed skills/knowledge in the process, and I may use them again sometime before I die. I lose so much productivity in these sort of witch hunts. Good thing I work for the government...