Learning Python by writing a screen scraper

Just for fun I decided to write a tool for work in Python instead of Perl, and I thought I’d describe the process. Partly because other people can be very opaque about how they learn things, and especially how they learn technical things or approach something unfamiliar.

At work, I had a big list of URLs to look through, to check a particular detail of sidebar widget code on each blog.

Originally, I got kind of excited as I browsed this page of twill commands. I installed twill on my laptop and tried out the examples. Wooo! That was so easy! It was like screen scraping with pseudocode. So, without really looking into it any further I figured it would be easy to churn through the few thousand URLs I needed to check. It looked like maybe a day of work, or two if I was floundering around, which is often likely when learning something new.

When I actually sat down to do it, I realized that twill didn’t have any control flow commands. So there wasn’t a way within twill, fabulous as it seemed, to tell it to go through a list of variables. So I started to try to write it in Python. I went to a few of Seth‘s informal Python lessons months ago and then paired with Danny a little bit. We wrote a thingie with Django to let people create random Culture names. (Result: I am the Human Sol-Terran Elizabeth Badgerina Karen da’Champions-West. I am currently travelling on a Ship, the ROU Knock Knock, Psychopath Class.) In other words, as of Monday, I could write Hello World in Python, but only if I look at the manual first.

So I wrote pseudocode first, like this:
read in biglist.txt
for each line in biglist.txt
split the line into $blogurl, $blogemail
get that url's http dump
if it has "OLDCODE" in it
Write $blogurl, $blogemail to hasoldcode.logfile
if not
if it has "NEWCODE" in it
write $blogurl, $blogemail to hasnewcode.logfile

Pseudocode rocks.

The Python docs made me want to chew my laptop in half. I read them anyway, mostly the string functions but that barely helped. Instead I just brute force googled things like “how do i find a substring in a string with python” which was often helpful if only so that I felt less lonely. It took me a while just to figure out how to concatenate two strings. I kept trying to use a dot, which didn’t work!

The most helpful thing was turning up bits of other people’s code, the simpler the better, with brief explanations.

The next most helpful thing was cheating by asking Danny, who kindly just said “Oh, do this, import urllib and do f=urllib2.urlopen(blog) and then h= ”.join(f.readlines()) and print h.” Testing things out in the interpreter was useful too. The point isn’t whether you lift it out of a class, a book, someone else’s code, or another person. Just start out with a few lines of something that works. Then, fiddle with it and master it.

But there was no way I could figure out from scratch what to do with the first giant horrible alpha-vomit error that popped up. Danny kindly IM-ed me “try: THINGIE except ValueError:” which I then googled and figured out how to use. Some googling of bits of the error message would have gotten me some useful examples. Here, I may have chickened out and asked for help too soon.

I put my pseudocode into a file as comments. I wrote a file of a few test urls and emails. Then I wrote the program kind of half-assedly a couple of times, piece by piece, only trying to do one thing at a time. It mostly worked. That was the end of Day 1.

In the morning life was much better. Then I rewrote my pseudocode to include all the things I’d forgotten. I threw everything out and started over. Suddenly I felt like I knew what I was doing. A couple of hours later it all worked great.

While I was in that state of knowing-what-I-was-doing and being able to see it all clearly, it was exactly like the point in writing a poem where I know the map ahead. It is knowing the map and how to navigate and having not just the destination but having built a mental image of the entire trip. So, as with going down a road where I’ve never been before, but have imagined out the map, I feel a sense of the entire poem, all at once. It’s a holographic feeling. In that state of mind, I am very happy, and want to work without stopping.

It’s funny to talk about such a simple bit of programming that way but that’s how it felt. I also knew where I was doing something in an inelegant way, but that it was okay and I’d fix it later.

When it was all working I paused for a bit, then went back and fixed the inelegant bit.

After that, I put in some status messages so I could watch them scroll past with every URL. (A good idea since the error checking is not very thorough.)

Here is the code. I can see more ways to improve it and make it more general. It would be nicer to just use the filename as the scrolling status message, perhaps giving the files names that would look better as they scroll past. There are also stylistic questions like, I know many people would combine

outfile = open(“gotsitedown.txt”,’a’)
outfile.writelines(msg)

into one line, but I couldn’t read that again and understand what it meant a month from now, so I tend not to write code that way. Maybe once I’m better at it.


#! /usr/bin/python
  import urllib2

  # This reads in a list of urls & emails, comma separated.
  # It checks each url for a specific phrase in its HTML
  # and writes the url and email to a log file.
  # The status print lines are for fun, to watch it scroll.

  lines = open("biglist.txt",'r').readlines()
  for l in lines:
   line = l.strip()
   try:
     (blog,email) = line.split(",")
   except ValueError:
     continue
   try:
     f = urllib2.urlopen(blog)
     h= ''.join(f.readlines())
     if 'NEW BIT OF CODE' in h:
        filename = "gotnewcode.txt"
        status = "New! "
        if 'OLD BIT OF CODE' in h:
          filename = "gotbothcodes.txt" # replaces filename!
          status = "Mixed up codes: "
     elif 'OLD BIT OF CODE' in h:
        filename= "gotoldcode.txt"
        status = "Old code: "
     else:
        filename = "gotnocode.txt"
        status = "No code here: "
     msg = blog + "," + email + "\n"
     outfile = open(filename,'a')
     outfile.writelines(msg)
     print  status + msg
  # check for 404 or other not found error
   except (urllib2.HTTPError, urllib2.URLError) :
     msg = blog + "," + email + "\n"
     outfile = open("gotsitedown.txt",'a')
     outfile.writelines(msg)
     status = "Site down: "
     print status + msg

My co-worker Julie was sitting across the table from me doing something maddeningly intricate with Drupal and at the end of the day she agreed with me that it is best to code something the wrong way at least twice in order to understand what you’re doing. “If I haven’t done it wrong three times, something is wrong.”

I wish now that I had written down all the wrong ways, or saved the wrong code, to compare how it improved. One wrong way went like this: instead of writing the 5 different logfiles of blogs with new code, old code, no code, site down, and mixed old and new code, I thought of making directories and writing all the url names to the directory. That was before I thought of putting the emails in a csv file with the urls. Why did it make sense at first? Who knows! It might be a good rule, though. The first think you think of is probably wrong. You can’t see a more optimal way until you have walked around in the labyrinth down some possible yet wrong ways.

This WordPress Code Highlighter Plugin might be the inspiration that pushes me finally off of Blogspot and onto WordPress for this blog, so that I can do this super nicely in text and not in an image.

Night terrors

The past two nights Moomin had episodes of night terror or “pavor nocturnus”. He had them a lot when he was younger, from 2 or 3 to around age 5. Basically, it’s a sleep disorder like sleepwalking, but instead of walking around in a confused way, the sleeping person feels a very extreme emotion of fear; absolute terror.

With Moomin, it would start with some mild coughing, and gasping or sobbing, starting out slow. Always just around 11pm or midnight, right when we were about to go to sleep ourselves. When we were tired and a bit ill tempered at having to get up.

After a bit of coughing Moomin would sit up in bed. He’d start to howl and scream. His heart would race and pound, he’d break out into a sweat, he’d be shaking and clenching his fists like he was in horrible pain.

It was really scary!

There was no way to snap him out of it or talk him down. He doesn’t really wake up, but might answer a couple of questions or babble nonsense. When he was younger it was scarier because it was hard to tell if he was actually super sick or not. It’s hard to see him terrified and apparently in pain. He’d also sometimes talk so incoherently, that was scary in itself. Last night he was saying “No!!! NO ELECTRIC!” But night terrors apparently aren’t coherent nightmares — they’re not bad dreams you can remember.

We try to comfort him, though it doesn’t help. When he was younger and we didn’t know what was happening I know sometimes we tried to snap him out of it. We’d be begging him to tell us what was wrong, what hurt, what was happening, if he was okay. I wish we had known about night terror as a sleep disorder, but I didn’t realize it till he was around 4 or 5.

It may have worked sometimes to get him to either drink something, or go to the bathroom, like it helped to snap him back into reality. Mostly though, we have to hold him and comfort him for about 20 minutes. He’d become truly conscious for about 5 seconds and then fall deeply asleep, no longer fitful and sweating.

That’s a long time!

Sometimes he’d get up and walk, or struggle to get out of our attempts to be comforting.

After he falls into normal sleep, he doesn’t remember what happened. If he woke up for a minute or two in the bathroom or living room he’d be confused and disoriented.

We had to warn people who were babysitting him. Just wait it out, hold him or reassure him he’s asleep (though that doesn’t help, it feels horrible to do nothing.)

For the last few years, his night terror episodes have been rare. A few times a year, maybe.

These episodes became somewhat less scary for me after Moomin had his appendix burst! Now *that* was scary! On the other hand, now when he has these midnight episodes, I am spared the worry that he might be dying of appendicitis. His appendix is gone already. Whew.

Anyway, if you’re a relatively new parent and your toddler or young child wakes up and screams in terror, don’t read “nightmares” into it or necessarily think they are having a severe health crisis. Also don’t assume they’re misbehaving or in hysterics. It might be night terrors — and isn’t their fault, or your fault.

It is scary and… I have to say… exasperating.

I wonder if tiny babies have this happen too, but people assume it’s colic or general infant fussiness? Surely it’s been studied.

Here’s a good description of http://kidshealth.org/parent/medical/sleep/terrors.html

>pavor nocturnus from kidshealth.org:

Night terrors typically occur about 2 or 3 hours after a child falls asleep, when sleep transitions from the deepest stage of non-REM sleep to lighter REM sleep, a stage where dreams occur. Usually this transition is a smooth one. But rarely, a child becomes agitated and frightened — and that fear reaction is a night terror.

During a night terror, a child might suddenly sit upright in bed and shout out or scream in distress. The child’s breathing and heartbeat might be faster, he or she might sweat, thrash around, and act upset and scared. After a few minutes, or sometimes longer, a child simply calms down and returns to sleep.

That’s exactly what we experience with Moomin. How comforting it was to find out that nothing serious was wrong, even if it does seem horrible for him to go through.

In the morning he never remembers that it happened.

Excite@Home bankruptcy trainwreck continues in slow motion

I cannot believe that I’m still getting legal notices about the Excite@Home bankruptcy and the pay they still owe me from October 2001. For real? Seven years of an utter waste of time and resources. How many lawyers are frittering away their lives and raking in the dough on this bullshit? They gave me most of my money long ago, from when they bounced all our last paychecks.

It stirs up my ire to get these snail mails, sometimes big fat packets of totally pointless legal documents. Some freaking genius should have made a webpage about a million years ago, for creditors (like me) to keep an email contact updated and they’d be able to pay us all that much more in saved postage costs.

Mostly though, I remember surviving the rounds of layoffs, reading Fucked Company every day along with all my co-workers, while then enduring the incredibly wankery company-wide pizza and beer meetings in the “garage” with endless power point slide shows about how great we were doing, that were obvious lies.

And the way they’d do some weird NASCAR event and whoop it up as if that was going to solve all our problems because it was cool.

The one satisfying thing was when they axed a couple of buildings after one brutal layoff, I took a whole lot of the office stuff and furniture they were throwing away and hauled it in my truck to donate it to the nearest elementary school, where second grade teachers fought like tigers over staplers and pairs of scissors. Where is the justice. They were desperate for petty office supplies while five blocks away a bunch of us basically wasted oxygen reading Fucked Company, downloading shit from Napster, and sighing bitterly as we waited for the axe to fall. *

There were some nice people at Excite (aka WebCrawler) that I worked with, but man, that company was so clearly going down. It was sad.

Anyway, everyone keep in mind if you need to get riled up, that there’s a bunch of really rich bankruptcy lawyers sailing their yachts around and enjoying their home movie theaters, still reaping the rich rewards of the dot-com crash.

* Note to future employers, actually I am a super hard worker until everyone around me has been laid off and doom is in the air.

Joy of unit testing

(From about 2 weeks ago, late at night)

I was just vaguely napping and realized I was still thinking in my sleep about the php code I had just been writing. Though I barely even know php at all, it wasn’t that hard to just guess at it because it was mostly like Perl. My thinking in Perl is a bit stuck. Today with Oblomovka I wrote out what I wanted my program to do, then he started writing tests. At first I didn’t get it that the tests didn’t run actually in the program. My thinking was inside out. I thought I’d run a bit of code, then run something that tested if it did it right, or that error/die statements would be sprinkled around. But as I saw what Oblomovka was doing it was like a light went on and I felt like everything I’ve written has been incredibly sloppy! Works fine, tells you if it doesn’t work, but was like wearing shoes instead of making a road. Or the other way around.

It was really fun to write the very simple tests and then figure out how to send it the simplest possible thing to fake it out so that the tests would pass. So for example if you were writing a simulated ball game, you would not start by simulating a baseball game. Instead, you might vaguely sketch out what happens in a game. Then, you’d write a test that goes like, “Does a ball exist? If not, FAIL.” You would watch it fail. It’s supposed to. Then think of the smallest thing it needs to do to pass. Your program would then merely need to go, “Oh hai. I’m a baseball” and the test would pass. You’d write another test that goes, “Is there a bat?” and “Is a baseball coming at my bat?” As you write fake bats, balls, and ball-coming-at-you actions, the baseball game starts to take shape. All the tests have to keep passing. The structure of how to build it becomes more clear, in a weird way. This isn’t quite the right analogy. I can’t quite get into the way of thinking and end up just hacking quickly on ahead. But for a little while, I felt the rightness of this way of doing things.

Technorati Tags: , , ,

Moomin goes to snack camp


M. at camp
Originally uploaded by Liz Henry

Moomin: This camp is GREAT! This is the best camp ever! They had Honey Nut Cheerios!!
Me: Hahahaha! Awesome! Hahahaahah!
Moomin: AND they had raisins.
Me: No way. Hahahaha. Raisins!
Moomin: Yes! At the first snack time before the aftercare they also had Cheezits!
Me: *DIES LAUGHING*
Moomin: Oh! I get it.
Me: Heehehehehehe
Moomin: You’re laughing because I sort of should be talking about the Marine Science part of the camp. And not the snacks.
Me: You are correct, my son. I do love good snacks. On the other hand did not pay freaking four hundred bucks for you to attend Snack Camp.
Moomin: Well, let me tell you about the sort of British things. They’re very tiny and live in salt ponds. I think, sort of British, but not really…
Me: Brine shrimp?
Moomin: YES! Sea monkeys! I learned about the ecology of estuaries! There’s this very, very bad thing, called acid rain. I petted a shark. And, we made a model of pollution, and then we smashed it!
Me: Oh well okay then, definitely $400 well spent.

Geek culture changes

I have gone from working in places where I have about 4 computers on my desk plus root everywhere to working for Silicon Valley startups where people bring their own laptop to the job and no one has ever seen a terminal window before. Most of the bloggers I know (and support at work) deal with their blogs and web hosts entirely from ftp desktop clients. And at someone else’s fairly technically oriented workplace that shall remain nameless, just the other day, I over heard two people talking:

Q: So why do you people use those window things? And why are they always those black screens? Is it like, to look like The Matrix or something?
A: Um, well, I think it’s just a culture thing. It’s old school. Or something.

As I was reading through scads of comments on php.net and the forums on phpWomen.org I thought about how some people post stuff like “and here’s how I like to indent my code“, with examples. Actually I like reading that stuff and when it’s super simple, all the better. Yet I never post my own notes and habits and cheap unix tricks, because I’m embarrassed they aren’t super whizz bang hackery but are just my thoughts on vim vs. vi, or notes on how to change my csh prompt to be different colors. Why don’t I post on that stuff? I might start. How many times over the years have I gone to look something up and ended up on shallowsky.com? A ZILLION TIMES! (Thanks Akkana!) I’m not posting for programmers – actually I might be posting for the bloggers who are only just trying out their new shell account and want to know what it can do.

So about geek culture changes. Aside from people who don’t scream when they see a command line, what about the deeper culture? I was reading Rebecca MacKinnon’s post Silicon Valley’s benevolent dictatorships and thinking back on all the pocket-watch-toting, vest-wearing, oddball sys admins I’ve known. MacKinnon (heavily quoting Danny O’Brien) describes how U.S. geeks put a lot of trust in technology and the internet:

we have come to depend way too heavily on a small number of Internet and telecoms companies to conduct the most private and intimate details of our professional and personal lives. As long as those companies have values aligned with our own and are run by people we think have integrity, we don’t see a huge problem. But what if the values cease to be aligned or political circumstances change?

While I agree with MacKinnon that a company’s leaders are important, I suspect that a lot of power right now is in the hands of sys admins, quite often the actual benevolent association or intersection of hippies and hacker-anarchists who inhabit university basements and run the backbone of the net. They’re also powerful in determining what happens. I think about what is happening and how it’s partly about a cultural shift in what people think the Internet is – rather than it being something you get your hands dirty in, that you play around with, where you bother to go read the RFCs even if you’re not writing them… something that people like you are *making*… you shift it and its policies – you are its state and government – to something you consume or use that is run by far-distant giant corporations (whether they are trustable or not is not the point.) I wonder about younger generations of sys admins. Are they DIY in spirit – and have they been activists? That matters too – along with privacy policies which in theory are set by legal departments and corporate heads – because the people who will implement that stuff often care and have influence.

Bloggers haul in tons of free stuff

I forgot to post about how I got a free camera! Whoever does the marketing for Flip is a genius, because forever more I will go around explaining to people how awesome my FREE CAMERA is. Plus, it has the satisfaction of a well-designed toy.

Whenever I mess around with it this is what happens:

People end up grabbing it from me. It’s so toylike that people aren’t scared of it. When was the last time you grabbed someone else’s video camera out of their hands and started filming? NOT… you’d be scared to touch most of them and you’d want the manual.

For years I have refused to deal with videocameras because they’re huge and expensive and have a million parts and I break them and lose the tapes, etc. But for months I’ve been playing with this Flip Video gadget and loving it. It only has a few buttons and doesn’t do anything fancy. It doesn’t have a million different “modes”. There is no annoying charger to lose so that the gadget becomes useless. It runs on a couple of AA batteries.

You turn it on, hit the record button, and have got 30 minutes of video. I tried it out without reading any instructions, and everything worked as I expected. When I hit the red button again, it stopped recording. Then when I started recording again, the camera was clearly making a new short video clip.

That’s it.

Only time in my life you’ll hear me say that I’m happy not to have a lot of options. No! I don’t want options! A little bit of zoom is just fine!

The lack of cables is also amazingly great. The USB connector flips out from inside the camera like a freaking switchblade. When I plugged it into my Mac, it installed its own software on my hard drive. The software is nothing too special or fast. Though it did the job, it was somewhat horrible. It downloaded all my short video clips into the flip software, and showed me — much like in iPhoto – an array of the clips, with a simple play and edit interface, and options to name and save each clip. I can upload them straight to YouTube. All of that is super handy.

But it was WAY handier to ignore the Flip software completely.

Just plug it in and treat it like a flash drive, drag the files off it, edit them (or not) and upload clips to Google Video, YouTube, or (for super short clips) to Flickr.

After I finish messing around with this video camera, I’m going to give it to Moomin. This is really a perfect videocamera for little kids — and for me.

You can zoom in an out a little bit. The video quality is not all perfect. But I sure don’t care. It’s funny but the video “quality” or resolution is the last thing I care about. I just want something cheap and convenient and easy.

Though… I recommend you get a cheap tripod for it to avoid embarrassing shakycam. The camera has a little screw-holder thingie on the bottom for a tripod. I’m thinking of keeping a small GorillaPod in my backpack for times when I’m planning to film more than 20 seconds.

Because when you give this camera to little kids (or me) you might get this, or this:

My other free stuff lately was all BlogHer conference swag:

gwendomama with headset swag

Free Bluetooth headset from Zivio! It’s called a Zivio Boom and came with a jillion different little earpieces. I like the changing colors on it and how the antenna-microphone retracts – it telescopes back into the body of the headset. It’s tiny for now, but I’m sure in 5 years we’ll laugh.

This was the other Best swag from BlogHer:

best blogher swag

Clockwise from upper left: KY lube, manicure set in sunglasses case, nail polish, 1GB flash drive bracelets from PBS Kids, Topix power outlet splitter (nice!!!), 1GB flash drive (from KY), snapfish gift card, stickers, Merci chocolate (LOTS), blogher heroes book excerpt, Word Girl comic book again from PBS, Zivio bluetooth headset (!!!!!), more KY, pens, Tmobile gift card (7 days, 20 bucks, super great, putting it right in my backpack… along with the lube).

Oddly I got a vial of “Zen oil” or some aromatherapy thing from Zivio as well. It smells nice and has the effect of Tiger Balm. I used it all this week on my forearms in the spot up near your elbow that hurts when you type too much. Why aromatherapy-tiger-balm with the headset? NO IDEA!

My 10 year old friend who cruised the sponsor rooms got a free Didj, which is sort of the next generation Leapster gadget for older kids.

didj

“Stick with me, kid,” I whispered. “Cute kid plus wheelchair, poster child city, they can’t resist, we’re going to own the world.” She laughed in outrage… but took the free stuff.

The whole conference I was sending people off to the secretly good tables to get the best free stuff. ”
Flash drive bracelets at the PBS table” I’d mutter. All the mom bloggers would be off like a shot. I was left holding my coffee talking to thin air. Oh man. We love the free geeky stuff.

Now, the down side of this whole bloggers-get-free-stuff shtick is the utter crap. Mostly that is books. I don’t know why! I love books! I love really good books. Why are there so many bad ones? Bad ones in my mailbox? It’s a mystery… Come on now. Keep nasty booksss, send awesome gadgets. I will put stickers and EL wire all over these free gadgets ONLY IF THEY DON’T SUCK and pose for photos licking all the free cameras and computers you care to fling in my direction.

That's what Grandmas are for, I guess

My mom just gave Moomin an earful of stories from her childhood. I tried to get my great-grandma to tell me about her childhood once. “Come on, Nana, what was it like, what was different? What was it like being a little girl in 190-whatever?” She couldn’t think of anything to say but finally said that she missed the fun of chasing the iceman’s horse-drawn wagon and begging for chips of ice. Since she got so embarrassed and her story made it sound like her childhood utterly sucked, I never asked again!

Not so with my mom. She regaled Moomin with stories of how her sisters and she would brutally gang up on each other for elbow and kick fights. Usually she wasn’t the one ganged up on, because she was the middle sister. She always tried to be the goody goody.

Life was incredibly unfair. She had eczema, so she couldn’t wash the dishes. Instead, one sister would wash the dishes one night. (Mime a sister daintily doing the dishes, nose stuck in the air, lording it over Tiny Grandma-to-Be and then flouncing off.) And the other sister would do the dishes on the other night. But *every night* my mom had to set the table, clear the table, dry the dishes and put them away, take out the trash, burn the trash! “Now I ask you, is that fair? Why didn’t they just buy me some fucking rubber gloves and let me take my turn washing the dishes!” (By this time Moomin is on the floor laughing, rolling around and holding his stomach.) Never mind the part about having to leave off watching Perry Mason 5 minutes early to set the table. How is THAT fair. Why didn’t they just have dinner 10 minutes later?

Every time she said “We were BRATS!” it was the funniest thing in the universe.

We ended up with some 50 year old resentment from the middle sister that she had to wear her (taller) younger sister’s hand me downs and constantly endure people’s surprise that she was the older one because she was so short. Then, a grim tale.

“And one day we were waiting for the bus after school and I got SO FED UP. I pushed her off the steps, and a teacher saw me. She said “K—!!!! You go right inside and tell your teacher what you did!” (Look of disbelief and deep consideration-of-not-doing-it.)

Moomin was hanging on every word… he completely understood…

“And I thought, what the hell! I’m going to feel like an asshole! So I went in (miming it) and told her (high little voice) “Teacher I pushed my sister down the steps.” And my teacher said “Did she get hurt?” and I said “No!” and she said “Why did you do it?” and I was like “Because she’s a little bitch! She’s a 5 year old bitch!”

Moomin was in physical pain from laughing so hard at his hilarious grandma. I followed him to his room where he kept trying to unfurl himself from laughing-too-hard-position. “OH MY GOD I can’t believe she SAID that” he screeched. “Please help me stop laughing!”

“Do you really think she said that when she was so little?”

“No!!! Why I can’t I stop laughing?”

I think of the bit in Louise Fitzhugh’s book “The Long Secret” where the grandmother tells Beth Ellen, “Shy people are angry people.” Certainly true for both my mom and Moomin. I think her stories are awesome, because little kids like Moomin don’t really hear enough about the actual feelings of people and instead a bit too much about what we want them to feel or think they should feel.

I’m not sure what he will conclude about the olden days. Maybe that little kids in crinolines swore a lot and went around brutally elbowing each other over rolls of Lifesavers.

Who are we women bloggers?

We know where we are. But who are we? What are we as a group? Are we a thing? Are we a group?

This might sound weird from a feminist anarchist geek. But I had an epiphany at work during a marketing meeting.

Gina, our head of sales, was trying to describe to the rest of us what it’s like to explain blogging to Fortune 500 company ad executives. They’re used to putting people in demographics, and defining types of people who they recognize as categories. There are understandable archetypes like “soccer mom”. There are “communities”. The companies know that things can be viral and that online advertising is the way to go and that blogs are cool. But how to explain what we are? Who we are? Why we’re powerful? Why we’re not a fad?

Digression: At the first couple of BlogHer conferences I was not convinced that the conference sponsorships were a good idea. They didn’t sway me. I felt marketed-to in a way that wasn’t quite comfortable, or that felt slightly off. I wondered why it wasn’t like other tech conferences, other blogging conferences. Why because we were women, didn’t more big tech advertisers or companies come to us and sponsor us? Where were Apple and Microsoft trying to sell us laptops or giving us cool schwag – after all, we were hard core bloggers and geeks enough to go to a blogging conference.

And yet, the conference was fabulous, and I felt that even the companies who didn’t get it, I had some respect for them just for showing up and putting up some cash. Maybe we were an experiment. They were trying to get in on this rumored wave of online stuff even if they didn’t know how. This year, things were different. There were insane levels of corporate sponsorship, but the way it was done mostly didn’t feel odd or wrong or presumptive that all women were a certain way. It felt like they were *getting it*. I didn’t feel alienated. I was charmed. While it was strange to be having a KY sponsored party in Macy’s lingerie department while drinking chocolate vodka and eating cookies, there was no way not to be charmed by the strangeness and by the free 1GB flash drives. Rather than showering us with glossy, expensive brochures we would just throw away, they put their product ads on flash drives that we’d find useful. That gave me a warmer feeling than the cayenne in the hot chocolate vodka. (Despite the perturbing heteronormativity of the lube’s his and her packaging, which gossip I will repeat that hippietastically we had asked them to offset with equal amounts of her and her packaging but the ball got dropped somewhere.) It was smart marketing to women who love their computers – whose computers are important parts of their lives. Same with the clever presence of PBS Kids. They gave out stuff that you’d actually want to give to your kid – again with the flash drives, this time as bracelets. Mood rings. Stickers. Comic books. And even if you didn’t have a kid, you were a kid once, and might like to see Grover and Grover’s puppeteer in person in the studio that PBS set up inside our conference. iRobot had demos and a raffle for Roombas, and also sponsored a latte cart. How civilized is that — don’t just market to me: make me *like you*. Free lattes at a place that I was fairly desperate for nicer-than-hotel-coffee was smart.

That’s very different from the old wave of internet advertising and marketing, the clumsy approaches that feel like this: We guess who you are, without listening. Then we tell you why you’re interested in this thing. Then we beg you to blog about it. Then we measure our success by click-throughs.

Think of radio advertisements. A sponsor takes a ball game, something that people want to have. And says, “Hey. We’re cool like this. We love baseball. We make Blahdeblah Product. We’re helping it be so that you get to hear this baseball game on the radio.” Internet ads need to be more like that. Radio advertisers didn’t have little implants in our brains that gave them precise metrics of whether we *that second* turned our eyeballs to look at a Blahdeblah Product. Instead, they banked on our experential happiness, our participation and investment in the ball game. We’d have a good feeling about the game and our enjoyment, and associate them with it, like a friend. Instead, bad net marketing grabs your head, forces it into a vise clamp and makes you look away from the game and at them while you fill out their survey. It’s intrusive and untrusting, essentially unfriendly.

What I realized during our meeting: we aren’t a consumer demographic. We aren’t the metrics. We aren’t defined by what we consume in the mental model of 20th century markets. We’re cultural producers. Through our blogs, we have open, mass access to the means of production. We’re unmediated and unfiltered, if we want to be. We’re also banding together to control how we’re mediating and filtering. A big medical company might try to hire writers to tell their “true stories” of being moms with cancer. But they would never hit the grass roots authenticity of Motherswithcancer.wordpress.com. I can read that site and completely trust that it’s not the zombie brainchild of Big Pharma. I read BlogHer and trust that, while it’s got ads on it and (now) big corporate sponsors, it’s not a department store mannequin’s version of “what women want”. It’s what women actually got together and said they wanted to do. It’s not a marketing category.

We are something new, a category not quite defined but still coalescing, something like Bluestockings or the French revolutionary feminists who ran their own newspapers in the 1830s. But unlike those tightly knit salons of intellectuals, we are a mass movement, a populist movement, with plenty of muscle and — collectively — economic power. We are not quite like what some people are trying to define us as:

* “the Association of University Women, who also shop”
* “the white 30-something soccer moms who write cutesily about only diapers”
* “men with boobs and social skills, who influence their network of friends”
* “sort of like journalists, but with no self esteem and you don’t have to pay them”
* “computer geeks lite, who want a pink iPhone” (okay, maybe that one)

Or whateverall they seemed to think we were.

What we are: a mass social movement of women who are moving into the public sphere. We are not depending on authority to tell us what or who we are. If we don’t fit into a demographic or a marketing category, that doesn’t mean we don’t get a public voice. We are redefining “what women are” in our society and the shifting marketing and ad markets are evidence that our redefinition is being heard. Publishers can say “Your story is too harsh. It’ll alienate readers. Change it. Your main character can’t be a black woman. Write about something else. That story about your special needs child is too depressing. ” Sure, they can say it – and they do. We tell those stories anyway and find they are deeply wanted and needed by other women.

We’re more like the women of the 1800s who started to be able to make a living from their writing. (Though men generated an enormous backlash against them and trivialized their work as being from a pack of scribbling women… babblers and amateurs who appeal to the crude taste of the masses and are not Literary Enough (for… what exactly?).) Have we hit critical mass, finally, with blogging? Can we end run capitalist patriarchy? Are we successfully changing it as it co-opts us?

Older feminists are standing back in a mildly skeptical way. Oh yes, we’ve heard this before, now is really the moment when we can all tell our stories, across class and race and gender and all barriers, and our histories won’t be lost. Right. We’ve never heard *that* one before. I really believe it’s true this time. We have to fight to keep it true, and to keep control and power in the hands of regular people, accessible to everyone. Keep that access to t
he means of production, cultural production, out there, and keep spreading it.

And by that I mean things as simple as: fight your local library not to block MySpace from their public access computers.

I also felt this deeply at the Global Voices Summit in Budapest. The technology is to the point where mobile phone are ubiquitous in developing countries. A protest happens a country’s mainstream media can’t cover it because of censorship or a threatening political environment, and yet videos go up on YouTube. Fighting for universal access to a decentralized Internet is crucial to our future, and all areas of this fight need to tie together and be allies.

So who are we and what are we? Women who are speaking, who are consumers who talk, sort of like journalists, sort of like authors; we are conscious, individually and, more and more, collectively, of our power to speak and be seen in the world of public discourse. We have jobs and we’re in public, we’re out of the domestic sphere, but our thoughts, the way we’re framed in public conversations, in the media, isn’t yet all the way out of the domestic sphere. My point is that we are no longer containable by old style media. We aren’t an elite of “influencers” to be courted and co-opted. We’re journalists who write about who we are, not what we’re told to write, like a million mommy-blogging Hunter S. Thompsons writing The Curse of Lono instead of their assigned sports article.

Butch as hell sys admin hacker women who will kick your ass

From a few completely different sources I have heard of nascent conferences to train women how to talk at tech conferences. From everything I have seen, women know perfectly well how to talk at technical and computing and web 2.0 conferences. But I still see posts like Stowe Boyd’s in puzzlement asking “Where are the women speakers?”

I would like to offer myself as a resource for tech conference organizers who can’t figure out how to find “the most qualified” women speakers on particular topics. Ask, and I will help to hook you up. If you find a speaker you are happy with based on my recommendations, then pay me per successful connection. I propose as well that if you usually lean on the few geeky women you know to diversify your conferences, pay them in the same way.

So, back to that issue of speaker training. Great idea, valuable service. I’d like to question the idea that women don’t know how to speak at conferences. Wait, I thought we were the communicators, the ones with the social skills, the teachers and professors, used to being heard by an audience. It’s not just about women who don’t know how to present themselves – it’s also about people who are so complacent in their own circles that they don’t know how to listen to the qualifications and capabilities of amazing women.