Since the days of the big Keystone protests, it’s become clear that the focus of environmental activism has moved away from trying to pressure the feds and towards making progress at the local level. What has happened nationally — changes to the Clean Air Act and the EPA, quiet climate negotiations with China (why were none of us invited?), and the American Recovery and Reinvestment Act — is important, but also inside baseball. There’s not much of the direct engagement between grassroots activists and national policy that happened, say, around the time the Clean Air and Clean Water Acts were first passed, in the 1970s.

Meanwhile, local environmentalism has been going like gangbusters. There’s the ongoing tussle between tiny Richmond, Calif., and Chevron, the Community Environmental Defense Council in upstate New York, the Sacred Headwaters in British Columbia, the Lummi and the Gateway Pacific Terminal in Washington state.

But how does a person get involved in local politics, anyway? I must have studied local government in high school, but I don’t remember it. We had student government — the elections were just like the race for prom king and queen, only less competitive. The end result was similar: Winners were expected to smile, not talk too much, and work on their parade wave.

One thing that seems to help is growing up in a political household. Many of the community organizers and politicians I’ve interviewed came from politically involved families; even if they weren’t politicians themselves, they had seen political campaigns roll out. They knew how to organize a boycott, how to figure out who they should be talking to in government, which political clubs they should be getting the endorsements of, and how to get the attention of the media.

The mechanics of community organizing are not often written about and even less frequently written about well. There is one book, though, that does a great job explaining how community organizing works at the local level — and manages to be completely delightful as well. In my years as a reporter, I’ve found myself returning to it over and over. That book is the Mayor of Castro Street: The Life and Times of Harvey Milk, by Randy Shilts. While it may seem at first glance like a dishy tale of the life and tragic murder of the first openly gay man elected to U.S. public office (and it is), it’s also a blueprint for how to get involved in city government as an outsider. In a more sensible world, it would be assigned in every high school civics class.

Harvey Milk took a convoluted route into politics. At the beginning of the ’60s, he was a 30-year-old working as a researcher at a Wall Street investment firm and living a comfortable, closeted existence in New York with a string of much younger, artistic boyfriends. By the end of the ’60s, he had long hair and love beads, and was working in the theater in both New York and San Francisco (Hair, Jesus Christ Superstar, a disastrous adaptation of Inner City Mother Goose by Eve Merriam). In 1973, he and a new boyfriend opened up a camera shop on Castro Street.

Milk turned out to be a mediocre businessman — partly because, after some run-ins with city government over business licensing fees, he realized that his true love was strategizing and speechifying about city politics. An unprecedented migration of gays into San Francisco from all over the country was underway, and the Castro, then a deeply conservative Irish Catholic neighborhood, was not taking it well. The Eureka Valley Merchants, the local merchants association, tried to block the business licenses of new, gay-owned businesses.

Milk was the first gay businessman on Castro to try to make contact with the neighborhood’s old-timers. Some he won over; others he outmaneuvered. He went ahead and helped found a separate merchants association, the Castro Valley Association, and organized its members to throw an enormous street fair. When Allan Baird, a local Teamster, asked him for help with a citywide boycott of Coors beer, Milk organized gay bars and got them on board, in exchange for the Teamsters agreeing to bring gays into the union.

The gays who were flooding into the Castro were moving there because they wanted to be gay, not because they wanted to get involved in politics. But Milk pressured his new neighbors to look at things differently. He asked all the customers in the shop if they were registered to vote, and if they weren’t, helped them fill out the forms right there. He could be ruthless in getting good publicity for the city’s burgeoning gay population. He used his theater experience to woo the media, sometimes even going to far as to stage events that he knew would play well on television. When an acquaintance, Bill Sipple, saved Gerald Ford from an assassination attempt, Milk told the press that Sipple was gay, against Sipple’s wishes. Bigger issues were at stake, he told a friend, who tried to talk him out of it. The movement needed gay heroes — even unwilling ones.

As gays became a major force in politics, the backlash was immediate and intense. John Briggs, a California state senator, proposed a ballot measure that would ban gays and lesbians, or anyone who seemed to associate with or support them, from teaching in public schools. The San Francisco police, many of whom had family connections to the Castro and felt that the neighborhood was being invaded, began to cruise through the neighborhood, looking for men who looked plausibly gay enough to beat up and then book on charges of resisting arrest.

In 1976, a measure passed in San Francisco that allowed candidates for supervisor to run for election in their own neighborhoods, instead of citywide. Milk had campaigned hard for this measure, knowing that it was key to changing the city’s power structure. He was elected to the Board of Supervisors by a landslide, as part of a crew of firsts — the city’s first Chinese supervisor, the first black woman supervisor, the first openly gay man.

Milk often told people that he would die before he turned 50, and he was right. He died at 48, murdered, along with the city’s mayor, George Moscone, by another supervisor named Dan White. Milk’s death is the vortex that most stories about his life tumble into; the Gus Van Sant-directed biopic, Milk, which won two Academy Awards, turns it into a dreamy, slow-motion spectacle, and indulges in the fantasy — which there isn’t much evidence for — that Dan White was tragically closeted and gay himself.

Because Harvey Milk thought he wasn’t going to make it to 50, and also because he got death threats all the time, his friends found that he had left detailed instructions for the people who had worked on his campaign, including a list of people that he wanted to consider filling his seat at the Board of Supervisors. Anne Kronenberg, his 24-year-old campaign manager agreed to do it, only to fail being approved by the new Mayor Dianne Feinstein when she asked Kronenberg how loyal she would be to the Feinstein administration, and Kronenberg responded, “As loyal as Harvey was.” The post wound up going to another campaign volunteer, Harry Britt — who arguably proved to be just as disloyal, but was more comfortable lying about it.

Milk, the movie, strangely leaves out the riot at city hall. During White’s trial, his lawyer argued that he was agitated and hopped up on sugary junk food at the time (a strategy that became known as the “Twinkie Defense”). The day that he was sentenced, he was given seven and a half years total for killing both men. (White ultimately served five years in prison.) That day, thousands of people marched to city hall, and when they arrived, began to tear it apart. By the end of the night, 61 police and 100 protesters would be in the hospital.

“Police were surprised and enraged at the depth of resistance that they encountered,” Shilts wrote. “Gays beat back police with branches torn from trees, chrome ripped from city buses, and slabs of asphalt torn from the street. As a young man torched the last police car, he shouted to a reporter, ‘Make sure you put in the paper that I ate too many Twinkies.’”

The following night, the rioters threw a disco party on Castro Street. It had been in the works for months — the party was in celebration of what would have been Harvey Milk’s 49th birthday. 20,000 people showed up. Many of them wore helmets, as a precaution in case further rioting broke out, but the night was peaceful, and ended in a 20,000-person singalong of “Happy Birthday.”

San Francisco is, and always will be, an odd case as far as city government goes. That said, I see the strategies that Milk applied play out in the political realm all the time, especially now, when the current state of campaign financing laws means that those who cannot afford to spend millions of dollars on political advertising have to rely on the techniques that worked so well in the Castro — grassroots organizing, face-to-face meetings, and pushing hard to register voters and get them to the polls.

The unlikely alliance between environmentalists, people concerned with immigrants rights, and people concerned about police brutality in Richmond, Calif., is straight from the Castro street playbook — as are the strategic moves to become a part of city hall, instead of railing against it from the outside, and the penchant for campy, exuberant political rallies. The Obama campaign worked the same approach to its advantage in 2008 and 2012 — advised by veteran organizer Marshall Ganz, they organized barber shops and hair salons as voter registration hubs. They did so well that today these techniques are referred to as “Obama-style campaign tactics.”

The thing that most seems to be missing in politics at the moment, which Milk deployed often as a strategic tool, is hope. Art Agnos, who campaigned against him for state assemblyman in 1976, found himself trading advice with Milk one night in a parking lot after a particularly fierce debate. “You talk about how you’re gonna throw the bums out,” Agnos said. “But how are you gonna fix things — other than beat me? You shouldn’t leave your audience on a down.”

After that, Shilts writes,

Agnos noted that Harvey started ending his speeches on an up note, a tone that became especially eloquent when Milk talked to gay audiences. He talked about the time when the only homosexuals he heard of were drag queens and child molesters; it was time to change that. … At meetings with fewer gays, Milk would change the words to black, Chicano, or whatever group he was wooing. Frank Robinson [Milk’s speechwriter] soon refined it into a polished appeal that sounded as if it came straight from the orations of Hubert Humphrey. Harvey’s friends began calling the pitch Harvey’s “hope speech.”

A quick study, Agnos thought — maybe too quick.

“Hope,” of course, was Obama’s 2008 banner. By 2012, his campaign team had concluded that hope wasn’t going to cut it — they made a calculated decision to focus on shame instead. And they won with it.

Milk’s friends often made fun of the “hope speech” —  especially after it acquired an anecdote about an earnest phone call from a young person in Altoona, Penn., who told Milk that what was happening in San Francisco was an inspiration to the rest of the country. Hope certainly didn’t come naturally to him — he had to consciously work it into the narrative of what was, unequivocally, a very frightening time in American history. By many accounts, Shilts wasn’t that hopeful a guy, either.

But I have to wonder whether, out of all the terrific books that I’ve read about politics (including Robert Caro’s The Power Broker and Taylor Branch’s three-volume biography of Martin Luther King), The Mayor of Castro Street is the one that I like the best — precisely because it is so hopeful, despite playing out in some of the country’s bleakest years. Maybe there is something to the whole “hope speech” idea.