I'm wondering if the use of sideband connections (introduced in v11) could be used to solve this problem.
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1086484/v11-iRules-Intro-to-Sideband-Connections.aspx
Specifically, you'd try to open a sideband connection to Facebook/twitter and if it fails, enable/disable options on pages that are being served.
For replacing text, you could either use a stream profile in conjunction with STREAM:: iRule primitives.
For pixels, I'm not too sure.