Yeah, sir, you seem to already know what you're doing.
If you have to leave first, you can just say something along the lines of 'Oh, I have to go, but, uh hey, you seem like a pretty cool guy/person to talk to, do you have a facebook or anything? I'll add you.'
In this modern times it's not so much an awkward question anymore.
Though it's a little awkward to answer/say no, so expect the people to say no to say it a little oddly.
So if you get an odd response like 'Oh I have a facebook but uh I don't use it so yeah' and make no effort to give you another email or phone number, they're probably not interested.
It also depends if your interest is in making friends or getting a possible date, or both.
For possible dates, a phone number is perfectly fine and appropriate to ask for.
Facebook might be a bit better if you already know them a little bit - it's different adding a random woman you just met today vs. that cute woman you've already been chatting to for a bit at the store.
Asking beforehand is a choice but not necessary - the friend request itself is a test of interest. No need to ask as if they're interested, they'd say yes. If not, continue talking to them and just pretend it never happened - there's also all kinds of reasons they may have said no. Some people have strict criteria for who their facebook friends will be, and they might still like you as a person but simply not know you well enough yet to accept it.