public static string GetPageID(string PageSrcFanPageUrl, ref string FanpageUrl) { #region Get FB Page ID Modified GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); string fbpage_id = string.Empty; try { if (PageSrcFanPageUrl.Contains("profile_owner")) { fbpage_id = ParseEncodedJsonPageID(PageSrcFanPageUrl, "profile_owner"); } if (string.IsNullOrEmpty(fbpage_id)) { if (PageSrcFanPageUrl.Contains("/feeds/page.php?id=")) { int startIndxFeeds = PageSrcFanPageUrl.IndexOf("/feeds/page.php?id=") + "/feeds/page.php?id=".Length; int endIndxFeeds = PageSrcFanPageUrl.IndexOf("\"", startIndxFeeds); fbpage_id = PageSrcFanPageUrl.Substring(startIndxFeeds, endIndxFeeds - startIndxFeeds); if (fbpage_id.Contains("&")) { fbpage_id = fbpage_id.Remove(fbpage_id.IndexOf("&")); } } else if (PageSrcFanPageUrl.Contains("page.php?id=")) { int startIndxFeeds = PageSrcFanPageUrl.IndexOf("/page.php?id=") + "/page.php?id=".Length; int endIndxFeeds = PageSrcFanPageUrl.IndexOf("\"", startIndxFeeds); fbpage_id = PageSrcFanPageUrl.Substring(startIndxFeeds, endIndxFeeds - startIndxFeeds); if (fbpage_id.Contains("&")) { fbpage_id = fbpage_id.Remove(fbpage_id.IndexOf("&")); } } else if (PageSrcFanPageUrl.Contains("php?page_id=")) { int startIndxFeeds = PageSrcFanPageUrl.IndexOf("php?page_id=") + "php?page_id=".Length; int endIndxFeeds = PageSrcFanPageUrl.IndexOf("\"", startIndxFeeds); fbpage_id = PageSrcFanPageUrl.Substring(startIndxFeeds, endIndxFeeds - startIndxFeeds); if (fbpage_id.Contains("&")) { fbpage_id = fbpage_id.Remove(fbpage_id.IndexOf("&")); } } else { //FanPagePosterLogger("Unable To like Fan Page Wall with " + Username + " and " + FanpageUrl); //return; } if (string.IsNullOrEmpty(fbpage_id)) { fbpage_id = HttpHelper.ExtractIDUsingGraphAPI(FanpageUrl, ref HttpHelper); } } } catch (Exception ex) { GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } return fbpage_id; #endregion }