Visiting my old hometown in a little while, only staying for a week or two. Is it worthwhile to reconnect to female friends (or even exes) that I haven't talked to in years via social media?

If so, what openers should I use, and what things should I mention when reconnecting?

If it's a bad idea, why?