You've just gotta find the right city. Really, I could've done it in the city near my family and it would've been plenty effective (40 mins away, and going home to visit would've been inconvenient).
But being without a car and a flight away from family forced me to get out more. There were some moments when I wanted to run back home, but I didn't, and I was glad for it.
If you've got the cash though, I mean, summer's coming soon. I think I started planning my thing around this time of year. I flew out June 1 and came back August 1. If you have a city in mind, get on Craigslist and start looking for housing, though don't expect anyone to offer to rent to you without being present. You've just gotta do like I did; arrange to meet them on the day you arrive, try to get on the lease and moved in that very day. Worst case, find an AirBnB for a week.
Don't count on being able to do the whole thing through AirBnB though. I tried that, and was "successful"... until the people backed out claiming they'd let some other tenant extend his stay after I'd mailed them a check. $20 check cancelation fee pissed me off. They sent the check back but I didn't fucking trust them. Really it was kind of a dumb risk in the first place.
Just know what your budget is, have the money available. Also know what you're gonna do with your days. My trip would've been a disaster if I hadn't found Meetup, or had Meetup in SF been as bad as it is in my home city. Thank god though, Meetup, like all tech things, is pretty awesome in SF.
Don't do this expecting to date or find a gf. Literally go into it wanting to discover yourself, do some research on your own time, meet people you'll never meet again, etc.
And of course, stay safe. Look at crime maps of the city, find an apartment either in a higher-end or quieter area. If you can't get this info for your target city, consider a different city.