本文整理汇总了C#中faceboardpro.FacebookUser类的典型用法代码示例。如果您正苦于以下问题:C# FacebookUser类的具体用法?C# FacebookUser怎么用?C# FacebookUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FacebookUser类属于faceboardpro命名空间,在下文中一共展示了FacebookUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostOnFanPageCommentWithURLAndItsImage
public void PostOnFanPageCommentWithURLAndItsImage(ref FacebookUser fbUser)
{
string Username = fbUser.username;
string Password = fbUser.password;
try
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
GlobusLogHelper.log.Info("Please Wait....");
GlobusLogHelper.log.Debug("Please Wait...");
lstFanPageURLs = lstFanPageURLs.Distinct().ToList();
List<string> lstPostMsg = lstMessageCollectionCommentLiker.Distinct().ToList();
string user = "";
string fdUserDesignation = "";
string feedbackParams = "";
#region MyRegion
string timelineUfi = "";
string timelineLogData = "";
string translate_on_load = "";
string add_comment_text_text = "";
string add_comment_text = "";
string comment_replace = "";
string comment = "1";
string __a = "1";
string UsreId = "";
string charset_test = "";
#endregion
string post_form_id = string.Empty;
string phstamp = Utils.GenerateTimeStamp();
int postsCount = 0;
foreach (string pageUrl in lstFanPageUrlCollectionCommentLiker )
{
try
{
int CountPostWall = 1;
string FanpageUrl = pageUrl;
if (FanpageUrl.Contains("?sk=wall"))
{
try
{
FanpageUrl = FanpageUrl.Remove(FanpageUrl.IndexOf("?sk=wall"));
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
FanpageUrl = FanpageUrl + "?sk=wall";
string wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
if (string.IsNullOrEmpty(wallPageSrc))
{
wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
if (string.IsNullOrEmpty(wallPageSrc))
{
FanpageUrl = FanpageUrl.Replace("?sk=wall", "");
wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
}
}
if (string.IsNullOrEmpty(wallPageSrc))
{
GlobusLogHelper.log.Debug("The page could not be found :- " + pageUrl);
GlobusLogHelper.log.Info("The page could not be found :- " + pageUrl);
continue;
}
List<string> FanpgeData = new List<string>();
// To Find all post data of a page
//******************************************************************
string[] Arraggregation_id = Regex.Split(wallPageSrc, "aggregation_id");
foreach (string itemFan in Arraggregation_id)
{
try
{
if (!itemFan.Contains("<!DOCTYPE"))
{
if (itemFan.Contains("/form") || itemFan.Contains("aggregation_id"))
{
string tempFan = itemFan;
FanpgeData.Add(tempFan);
}
}
//.........这里部分代码省略.........
示例2: PostOnPageWallFacebooker
public List<string> PostOnPageWallFacebooker(string Keyword, ref FacebookUser fbUser)
{
List<string> FanPageUrls = new List<string>();
try
{
#region Post variable
string fbpage_id = string.Empty;
string __user = string.Empty;
#endregion
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
#region MyRegion
//Array paramArray = new object[8];
//paramArray = (Array)postParams;
//string Username = (string)paramArray.GetValue(0);
//string Password = (string)paramArray.GetValue(1);
//string proxyAddress = (string)paramArray.GetValue(2);
//string proxyPort = (string)paramArray.GetValue(3);
//string proxyUserName = (string)paramArray.GetValue(4);
//string proxyPassword = (string)paramArray.GetValue(5);
//string Keyword = (string)paramArray.GetValue(6);
//string Message = (string)paramArray.GetValue(7);
// string campaignName = (string)paramArray.GetValue(8);
//if (fbLoginChecker.CheckLogin(ResponseLogin, Username, Password))
#endregion
//
GlobusLogHelper.log.Debug("Searching Fan Page Using keyword: " + Keyword);
GlobusLogHelper.log.Info("Searching Fan Page Using keyword: " + Keyword);
string pgSrc_FanPageSearch = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/search.php?q=" + Keyword + "&type=pages"));
__user = GlobusHttpHelper.GetParamValue(pgSrc_FanPageSearch, "user");
if (string.IsNullOrEmpty(__user))
{
__user = GlobusHttpHelper.ParseJson(pgSrc_FanPageSearch, "user");
}
string AjaxRequest = Utils.getBetween(pgSrc_FanPageSearch, "href=\"#\" ajaxify=", "type=pages");
AjaxRequest = "https://www.facebook.com"+AjaxRequest.Replace("\"", string.Empty).Replace("amp;", string.Empty) + "type=pages";
List<string> pagesList = GetPages_FBSearch(pgSrc_FanPageSearch);
List<string> distinctPages = pagesList.Distinct().ToList();
///More Pages
string ajaxRequestURL = GetAjaxURL_MoreResults(pgSrc_FanPageSearch);
ajaxRequestURL = "https://www.facebook.com/" + ajaxRequestURL + "&__a=1&__user=" + __user + "";
ajaxRequestURL = Uri.UnescapeDataString(ajaxRequestURL) + "&init=quick";
string res_ajaxRequest = HttpHelper.getHtmlfromUrl(new Uri(ajaxRequestURL));
#region for find friend Reqest Link
List<string> list = new List<string>();
List<string> lstLinkData = new List<string>();
string[] Linklist = System.Text.RegularExpressions.Regex.Split(res_ajaxRequest, "href=");
foreach (string itemurl in Linklist)
{
if (!itemurl.Contains("<!DOCTYPE html"))
{
if (itemurl.Contains(@"https:\/\/www.facebook.com"))
{
lstLinkData.Add(itemurl);
string strLink = itemurl.Substring(0, 70);
if (strLink.Contains("https:\\/\\/www.facebook.com") && (strLink.Contains("onclick") || strLink.Contains("data-gt=\\")))
{
try
{
string[] tempArr = strLink.Split('"');
string temp = tempArr[1];
temp = temp.Replace("\\", "");
list.Add(temp);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
}
#endregion
list = list.Distinct().ToList();
distinctPages.AddRange(list);
FanPageUrls = distinctPages;
}
//.........这里部分代码省略.........
示例3: StartCmpFanPageLikerProcess
public void StartCmpFanPageLikerProcess(ref FacebookUser fbUser, string cmpName, string cmpProcess, string account, List<string> lstFanPageURLs, List<string> lstFanPageMessages, List<string> lstFanPageComments)
{
try
{
Pages.PageManager objPageManager = new Pages.PageManager();
if (cmpProcess == "Like Page")
{
objPageManager.LikePage(ref fbUser, lstFanPageURLs);
}
else if (cmpProcess == "Share Page")
{
objPageManager.SharePage(ref fbUser, lstFanPageURLs);
}
else if (cmpProcess == "Like Post")
{
objPageManager.LikePost(ref fbUser, lstFanPageURLs, lstFanPageMessages);
}
else if (cmpProcess == "Comment On Post")
{
objPageManager.CommentOnPost(ref fbUser, lstFanPageURLs, lstFanPageComments);
}
else
{
GlobusLogHelper.log.Info("Campaign Process Is Not Selected With Username : " + fbUser.username);
GlobusLogHelper.log.Debug("Campaign Process Is Not Selected With Username : " + fbUser.username);
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
示例4: LikePostUpdatedMethodNew
public void LikePostUpdatedMethodNew(ref FacebookUser fbUser, List<string> lstFanpageURLs, List<string> lstFanpageMessages)
{
try
{
int CounterLikePost = 1;
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
string link_data = string.Empty;
#region Post variable
string post_form_id = string.Empty;
string fbpage_id = string.Empty;
string fb_dtsg = string.Empty;
string __user = string.Empty;
string xhpc_composerid = string.Empty;
string xhpc_targetid = string.Empty;
string xhpc_composerid12 = string.Empty;
int NoOfEmailAccount = 20;
string message = string.Empty;
int noOfPosts = NoOfPostFanPageLikercount;
List<string> arrftentidentifier_itemList = new List<string>();
#endregion
GlobusLogHelper.log.Info("Start Like Post with " + fbUser.username);
GlobusLogHelper.log.Debug("Start Like Post with " + fbUser.username);
queFanPageURLsFanPageLiker.Clear();
queFanPageMessagesFanPageLiker.Clear();
foreach (string item in lstFanpageURLs)
{
PageManager.queFanPageURLsFanPageLiker.Enqueue(item);
}
foreach (string item in lstFanpageMessages)
{
PageManager.queFanPageMessagesFanPageLiker.Enqueue(item);
}
string FanpageUrl = "";//(string)paramArray.GetValue(6);
string ResponseLogin = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));
__user = GlobusHttpHelper.GetParamValue(ResponseLogin, "user");
if (string.IsNullOrEmpty(__user))
{
__user = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
}
if (string.IsNullOrEmpty(__user) || __user == "0" || __user.Length < 3)
{
GlobusLogHelper.log.Info("Please Check The Account : " + fbUser.username);
GlobusLogHelper.log.Debug("Please Check The Account : " + fbUser.username);
return;
}
string pageSource1 = ResponseLogin;
//JS, CSS, Image Requests
//RequestsJSCSSIMG.RequestJSCSSIMG(pageSource1, ref HttpHelper);
string Keys = string.Empty;
string Dc = string.Empty;
if (ResponseLogin.Contains("fb_dtsg"))
{
fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");
}
if (ResponseLogin.Contains("post_form_id"))
{
post_form_id = GlobusHttpHelper.GetParamValue(ResponseLogin, "post_form_id");
}
foreach (string FanPageUrl in queFanPageURLsFanPageLiker)
{
GlobusLogHelper.log.Info("Start Like Post On the URL : " + FanPageUrl + " with " + fbUser.username);
GlobusLogHelper.log.Debug("Start Like Post On the URL : " + FanPageUrl + " with " + fbUser.username);
string FanUrl = string.Empty;
string FanName = string.Empty;
List<string> lstPostID = new List<string>();
FanUrl = FanPageUrl;
FanUrlCounter++;
if (FanUrl.Contains("?sk=wall"))
{
FanUrl = FanUrl.Remove(FanUrl.IndexOf("?sk=wall"));
}
FanUrl = FanUrl + "?sk=wall";
string FanPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanUrl));
if (string.IsNullOrEmpty(FanPageSrc))
{
FanPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanUrl));
}
if (string.IsNullOrEmpty(FanPageSrc))
{
GlobusLogHelper.log.Info("The page could not be found :- " + FanPageSrc);
GlobusLogHelper.log.Debug("The page could not be found :- " + FanPageSrc);
continue;
}
string pageId = string.Empty;
pageId=Utils.getBetween(FanPageSrc,"pageID\":",",");
fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(FanPageSrc);
string[] splitFanUrl = FanUrl.Split('/');
FanName = splitFanUrl[splitFanUrl.Length - 1].Split('?')[0];
string[] fanDetails = Regex.Split(FanPageSrc, "href=");
//.........这里部分代码省略.........
示例5: GetFriendUserId
public string GetFriendUserId(ref FacebookUser fbUser, string profileUrl)
{
string FriendsId = string.Empty;
try
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
string pageSource = string.Empty;
string Profile_Id = profileUrl;
string ProfileNewUrl = string.Empty;
profileUrl = profileUrl.Replace("https://www.facebook.com", "https://graph.facebook.com");
if (profileUrl.Contains("profile.php?"))
{
profileUrl = profileUrl.Replace("profile.php?id=", string.Empty);
}
pageSource = HttpHelper.getHtmlfromUrl(new Uri(profileUrl));
FriendsId = getBetween(pageSource, "\"id\": \"", "\",\n");
if (string.IsNullOrEmpty(FriendsId) || !Utils.IsNumeric(FriendsId))
{
FriendsId = Utils.getBetween(Profile_Id, "php?id=", "&");
ProfileNewUrl = "https://graph.facebook.com/" + FriendsId;
pageSource = HttpHelper.getHtmlfromUrl(new Uri(ProfileNewUrl));
FriendsId = getBetween(pageSource, "\"id\": \"", "\",\n");
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
return FriendsId;
}
示例6: StartFanPageLikerProcess
public void StartFanPageLikerProcess(ref FacebookUser fbUser)
{
try
{
if (StartProcessUsingFanPageLiker == "Like Page")
{
LikePage(ref fbUser, lstFanPageUrlsFanPageLiker);
}
if (StartProcessUsingFanPageLiker == "Share Page")
{
SharePage(ref fbUser, lstFanPageUrlsFanPageLiker);
}
if (StartProcessUsingFanPageLiker == "Like Post" && !isLikePostThroughFreindsUrls)
{
//LikePostUpdatedMethod(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageMessageFanPageLiker);
LikePostUpdatedMethodNew(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageMessageFanPageLiker);
}
if (StartProcessUsingFanPageLiker == "Comment On Post")
{
if (lstFanPageCommentsFanPageLiker.Count == 0)
{
GlobusLogHelper.log.Info("Please Upload Fan Page Comments..! ");
GlobusLogHelper.log.Debug("Please Upload Fan Page Comments..! ");
return;
}
CommentOnPost2(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
// CommentOnPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
GlobusLogHelper.log.Info("Process completed With :" +fbUser.username);
GlobusLogHelper.log.Debug("Process completed With :" + fbUser.username);
}
if (StartProcessUsingFanPageLiker == "Comment On Recent Post")
{
//CommentOnPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
CommentOnRescentPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
GlobusLogHelper.log.Info("Process completed With :" + fbUser.username);
GlobusLogHelper.log.Debug("Process completed With :" + fbUser.username);
}
if (StartProcessUsingFanPageLiker == "Like Post" && isLikePostThroughFreindsUrls)
{
LikePostsOnFreindsPage(ref fbUser, lstFreindsPagePostsLiker);
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
示例7: SharePage
public void SharePage(ref FacebookUser fbUser, List<string> lstFanPageUrlsFanPageLiker)
{
try
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
#region Post variable
string fbpage_id = string.Empty;
string fb_dtsg = string.Empty;
string __user = string.Empty;
string xhpc_composerid = string.Empty;
string xhpc_targetid = string.Empty;
string xhpc_composerid12 = string.Empty;
int NoOfEmailAccount = 20;
int NoOfcount = 0;
#endregion
List<string> FanpageUrls = lstFanPageUrlsFanPageLiker;//(List<string>)paramArray.GetValue(6);
foreach (string item in FanpageUrls)
{
try
{
string FanpageUrl = item;
string PageSrcFanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
GlobusLogHelper.log.Info("Started Sharing Page : " + FanpageUrl + " With UserName : " + fbUser.username);
GlobusLogHelper.log.Debug("Started Sharing Page : " + FanpageUrl + " With UserName : " + fbUser.username);
Thread.Sleep(Utils.GenerateRandom(300, 1200));
__user = GlobusHttpHelper.GetParamValue(PageSrcFanPageUrl, "user");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
if (string.IsNullOrEmpty(__user))
{
__user = GlobusHttpHelper.ParseJson(PageSrcFanPageUrl, "user");
}
if (string.IsNullOrEmpty(__user) || __user == "0" || __user.Length < 3)
{
GlobusLogHelper.log.Info("Please Check The Account : " + fbUser.username);
GlobusLogHelper.log.Debug("Please Check The Account : " + fbUser.username);
return;
}
fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(PageSrcFanPageUrl);
string appid = string.Empty;
string PValue = string.Empty;
string ImageUrl = string.Empty;
try
{
try
{
appid = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("appid="), (PageSrcFanPageUrl.IndexOf("&", PageSrcFanPageUrl.IndexOf("appid=")) - PageSrcFanPageUrl.IndexOf("appid="))).Replace("appid=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
}
catch(Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
if (appid.Length > 15)
{
appid = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("appid="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("appid=")) - PageSrcFanPageUrl.IndexOf("appid="))).Replace("appid=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
try
{
try
{
PValue = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("p[]="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("p[]=")) - PageSrcFanPageUrl.IndexOf("p[]="))).Replace("p[]=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
if (PValue.Contains(",idnull,") || PValue.Contains(","))
{
PValue = PValue.Split(',')[0];
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
if (appid.Length > 15)
{
PValue = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("p[]="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("p[]=")) - PageSrcFanPageUrl.IndexOf("p[]="))).Replace("p[]=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
}
}
catch (Exception ex)
//.........这里部分代码省略.........
示例8: UploadImageOnPage
public void UploadImageOnPage(ref FacebookUser fbUser)
{
try
{
foreach (string item in lstFanPageUrlCollectionFanPagePoster)
{
try
{
StartImageUploadingOnPage(ref fbUser, item);
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
示例9: StartImageUploadingOnPage
public void StartImageUploadingOnPage(ref FacebookUser fbUser, string PageUrl)
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
string strUserName = fbUser.username;
string strProxyAddress = fbUser.proxyusername;
string strProxyUserName = fbUser.proxyusername;
string strProxyPassword = fbUser.proxypassword;
string strProxyPort = fbUser.proxyport;
try
{
GlobusLogHelper.log.Debug(" Starting Image Upload With Username : " + strUserName + " On The URL : " + PageUrl);
GlobusLogHelper.log.Info(" Starting Image Upload With Username : " + strUserName + " On The URL : " + PageUrl);
string pics = string.Empty;
string message = string.Empty;
string pageId = string.Empty;
string session_id = string.Empty;
string grid_Id = string.Empty;
string waterfallId=string.Empty;
if (string.IsNullOrEmpty(strProxyPort))
{
strProxyPort = "80";
}
string res_Home = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl)); //"https://www.facebook.com/"
string __user = GlobusHttpHelper.GetParamValue(res_Home, "user");
if (string.IsNullOrEmpty(__user))
{
__user = GlobusHttpHelper.ParseJson(res_Home, "user");
}
string fb_dtsg = Get_fb_dtsg(res_Home);
string res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(PageUrl));
string ComposerId = string.Empty;
pageId = Utils.getBetween(res_get_FanPage, "{\"pageID\":\"", "\"}]]]");
ComposerId=Utils.getBetween(res_get_FanPage,"composerid\" value=\"","\"");
#region for
for (int i = 0; i < noOfPicsPerURL; i++)
{
try
{
if (picsCounter < lstPicturecollectionPostPicOnFanPageWall.Count)
{
pics = lstPicturecollectionPostPicOnFanPageWall[picsCounter];
picsCounter++;
}
else
{
GlobusLogHelper.log.Debug("All pics used up : " + strUserName);
GlobusLogHelper.log.Info("All pics used up : " + strUserName);
return;
}
if (lstFanPageCollectionFanPagePosterMessage.Count > 0)
{
message = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
}
string ImagePostClickResp = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/composerx/attachment/media/upload/?av=" + __user + "&composerurihash=1"), "fb_dtsg=" + fb_dtsg + "&composerid=" + ComposerId + "&targetid=" + pageId + "&composercontext=composer&isfinch=1&loaded_components[0]=maininput&loaded_components[1]=withtaggericon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=mainprivacywidget&loaded_components[5]=withtaggericon&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_main_column&__user=" + __user + "&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgSmEVFLFwxBxvyUW5ogDyQqUjhpoW8xOdy8-&__req=g&ttstamp=2658170819911711579109529989&__rev=1561259");
grid_Id = Utils.getBetween(ImagePostClickResp, "\"gridID\":\"", "\"");
waterfallId=Utils.getBetween(ImagePostClickResp,"\"waterfallID\":\"","\"");
NameValueCollection nvc = new NameValueCollection();
nvc.Add("fb_dtsg",fb_dtsg);
nvc.Add("source","8");
nvc.Add("profile_id",__user);
nvc.Add("grid_id",grid_Id);
nvc.Add("qn",waterfallId);
nvc.Add("0", "" + pics + "<:><:><:>image/jpeg");
nvc.Add("upload_id", "1024");
string imgUploadResp = HttpHelper.UploadImageWaterfallModel("https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id=" + pageId + "&image_height=100&image_width=100&letterbox=0&av=" + __user + "&qn=" + waterfallId + "&__user=" + __user + "&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4pbGAdBGeqrWo8ponUKexm49UJ6K4Qmmey8szoyfw&__req=p&fb_dtsg=" + fb_dtsg + "&ttstamp=2658170819911711579109529989&__rev=1561259", PageUrl, nvc, "upload_id", "0");
string UnPublishId = Utils.getBetween(imgUploadResp, "\"fbid\":\"", "\"");
NameValueCollection nvc1 = new NameValueCollection();
nvc1.Add("composer_session_id", "57c32c98-d4b9-4f5a-9fb9-6452e01e24bb");
nvc1.Add("fb_dtsg",fb_dtsg);
nvc1.Add("xhpc_context","profile");
nvc1.Add("xhpc_ismeta","1");
nvc1.Add("xhpc_timeline",string.Empty);
nvc1.Add("xhpc_composerid", ComposerId);
nvc1.Add("xhpc_finch", "1");
nvc1.Add("xhpc_targetid", pageId);
nvc1.Add("xhpc_publish_type", "1");
nvc1.Add("clp", "{\"cl_impid\":\"626b99df\",\"clearcounter\":0,\"elementid\":\"u_0_19\",\"version\":\"x\",\"parent_fbid\":"+pageId+"}");
nvc1.Add("xhpc_message",message);
nvc1.Add("composer_unpublished_photo[]",UnPublishId);
nvc1.Add("album_type","128");
nvc1.Add("is_file_form","1");
nvc1.Add("oid", string.Empty);
nvc1.Add("qn", waterfallId);
nvc1.Add("application","composer");
nvc1.Add("is_explicit_place",string.Empty);
nvc1.Add("composertags_place",string.Empty);
nvc1.Add("composertags_place_name", string.Empty);
nvc1.Add("tagger_session_id", "1421254406");
nvc1.Add("composertags_city",string.Empty);
//.........这里部分代码省略.........
示例10: PostOnFanPageWallWithURLAndItsImageNew
public void PostOnFanPageWallWithURLAndItsImageNew(ref FacebookUser fbUser)
{
try
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
string Username = string.Empty;
string Password = string.Empty;
GlobusLogHelper.log.Debug("Please Wait------------!");
GlobusLogHelper.log.Info("Please Wait------------!");
Array paramArray = new object[10];
string Userss = fbUser.username;
int CountPostWall = 1;
//string FanpageUrl = (string)paramArray.GetValue(6);
lstFanPageUrlCollectionFanPagePoster = lstFanPageUrlCollectionFanPagePoster.Distinct().ToList();
lstFanPageURLs = lstFanPageUrlCollectionFanPagePoster;
lstFanPageUrlCollectionFanPagePostUrl = lstFanPageUrlCollectionFanPagePostUrl.Distinct().ToList();
lstFanPagePostURLs = lstFanPageUrlCollectionFanPagePostUrl;
string composer_session_id = "";
string fb_dtsg = "";
string xhpc_composerid = "";
string xhpc_targetid = "";
string xhpc_context = "";
string xhpc_fbx = "";
string xhpc_timeline = "";
string xhpc_ismeta = "";
string xhpc_message_text = "";
string xhpc_message = "";
#region MyRegion
string uithumbpager_width = "128";
string uithumbpager_height = "128";
string composertags_place = "";
string composertags_place_name = "";
string composer_predicted_city = "";
string is_explicit_place = "";
string composertags_city = "";
string disable_location_sharing = "false";
string audiencevalue = "80";
string nctr_mod = "pagelet_timeline_recent";
string UsreId = "";
string __a = "1";
string phstamp = "";
#endregion
Username = Userss;
GlobusLogHelper.log.Info("Start Process of Wall Posting With Username.... >>> " + Username);
GlobusLogHelper.log.Debug("Start Process of Wall Posting With Username.... >>> " + Username);
int Counter = 0;
foreach (var lstFanPageURLsitem in lstFanPageURLs)
{
while (true)
{
Counter = Counter + 1;
try
{
//Counter = Counter + 1;
if (Counter > noOfPicsPerURL)
{
break;
}
string strFanPageURL = lstFanPageURLsitem;
string strPageSource = HttpHelper.getHtmlfromUrl(new Uri(strFanPageURL));
if (strPageSource.Contains("xhpc_composerid") && strPageSource.Contains("xhpc_targetid") && strPageSource.Contains("xhpc_context")) //&& strPageSource.Contains("xhpc_fbx")
{
UsreId = GlobusHttpHelper.Get_UserID(strPageSource);
fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(strPageSource);
xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_composerid");
xhpc_targetid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_targetid");
xhpc_context = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");
xhpc_fbx = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_fbx");
xhpc_timeline = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_timeline");
xhpc_ismeta = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_ismeta");
xhpc_message_text = lstFanPagePostURLs[new Random().Next(0, lstFanPagePostURLs.Count)];
xhpc_message = xhpc_message_text;
//lstFanPagePostURLs.Remove(xhpc_message);
//xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");
//xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");
if (string.IsNullOrEmpty(UsreId))
{
UsreId = GlobusHttpHelper.ParseJson(strPageSource, "user");
}
string composer_session_idSource = HttpHelper.getHtmlfromUrl(new Uri(faceboardpro.FBGlobals.Instance.pageFanPageAjaxMetaComposerTargetidUrl + UsreId + "&xhpc=composerTourStart&nctr[_mod]=pagelet_composer&__user=" + UsreId + "&__a=1"));//Convert.ToInt32(ConvertToUnixTimestamp(DateTime.Now)).ToString();
if (composer_session_idSource.Contains("composer_session_id"))
//.........这里部分代码省略.........
示例11: StartImageUploading
public void StartImageUploading(ref FacebookUser fbUser, string url)
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
string strUserName = fbUser.username;
string strProxyAddress = fbUser.proxyusername;
string strProxyUserName = fbUser.proxyusername;
string strProxyPassword = fbUser.proxypassword;
string strProxyPort = fbUser.proxyport;
try
{
GlobusLogHelper.log.Debug(" Starting Image Upload With Username : " + strUserName + " On The URL : " + url);
GlobusLogHelper.log.Info(" Starting Image Upload With Username : " + strUserName + " On The URL : " + url);
string pics = string.Empty;
string message = string.Empty;
string pageId = string.Empty;
string session_id = string.Empty;
if (string.IsNullOrEmpty(strProxyPort))
{
strProxyPort = "80";
}
string res_Home = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl)); //"https://www.facebook.com/"
string __user = GlobusHttpHelper.GetParamValue(res_Home, "user");
if (string.IsNullOrEmpty(__user))
{
__user = GlobusHttpHelper.ParseJson(res_Home, "user");
}
string fb_dtsg = Get_fb_dtsg(res_Home);
string res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(url));
if (res_get_FanPage.Contains("?page_id="))
{
pageId = res_get_FanPage.Substring(res_get_FanPage.IndexOf("?page_id="), res_get_FanPage.IndexOf("\"", res_get_FanPage.IndexOf("?page_id=")) - res_get_FanPage.IndexOf("?page_id=")).Replace("?page_id=", string.Empty).Replace("\"", string.Empty).Trim();
}
res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerPagesGetting + pageId + ""));
string postURL_identity = FBGlobals.Instance.PageManagerPageIdentitySwitchPhp;
string postData_identity = "fb_dtsg=" + fb_dtsg + "&user_id=" + pageId + "&url=" + Uri.EscapeUriString(url) + "";
res_get_FanPage = HttpHelper.postFormData(new Uri(postURL_identity), postData_identity);
string composerid = GlobusHttpHelper.GetParamValue(res_get_FanPage, "composerid");
if (string.IsNullOrEmpty(composerid))
{
composerid = GlobusHttpHelper.ParseJson(res_get_FanPage, "composerid");
}
string targetid = GlobusHttpHelper.GetParamValue(res_get_FanPage, "targetid");
if (string.IsNullOrEmpty(targetid))
{
targetid = GlobusHttpHelper.ParseJson(res_get_FanPage, "targetid");
}
#region for
for (int i = 0; i < noOfPicsPerURL; i++)
{
try
{
if (picsCounter < lstPicturecollectionPostPicOnFanPageWall.Count)
{
pics = lstPicturecollectionPostPicOnFanPageWall[picsCounter];
picsCounter++;
}
else
{
GlobusLogHelper.log.Debug("All pics used up : " + strUserName);
GlobusLogHelper.log.Info("All pics used up : " + strUserName);
return;
}
if (lstFanPageCollectionFanPagePosterMessage.Count > 0)
{
message = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
}
///composer hash1
string postURL_composerhash1 = FBGlobals.Instance.PageManagerPageAjaxComposerx1;
string postData_composerhash1 = "fb_dtsg=" + fb_dtsg + "&composerid=" + composerid + "&targetid=" + targetid + "&istimeline=1&composercontext=composer&loaded_components[0]=maininput&loaded_components[1]=backdateicon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=backdateicon&loaded_components[5]=mainprivacywidget&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_recent&__user=" + __user + "&__a=1&__dyn=7n8ahyj35whVag&__req=4&phstamp=1658167108458977122472";
string res_post_composerhash1 = HttpHelper.postFormData(new Uri(postURL_composerhash1), postData_composerhash1);
///composer hash2
///
string postURL_composerhash2 = FBGlobals.Instance.PageManagerPageAjaxComposerx2;
string postData_composerhash2 = "fb_dtsg=" + fb_dtsg + "&composerid=" + composerid + "&targetid=" + targetid + "&istimeline=1&composercontext=composer&loaded_components[0]=maininput&loaded_components[1]=backdateicon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=backdateicon&loaded_components[5]=mainprivacywidget&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_recent&__user=" + __user + "&__a=1&__dyn=7n88QoAMNo4uiA&__req=5&phstamp=1658167108458977122472";
string res_post_composerhash2 = HttpHelper.postFormData(new Uri(postURL_composerhash2), postData_composerhash2);
//.........这里部分代码省略.........
示例12: StartActionFanPagePoster
private void StartActionFanPagePoster(ref FacebookUser fbUser)
{
try
{
if (StartProcessUsingFanPagePoster == "Post Urls")
{
PostOnFanPageWallWithURLAndItsImage(ref fbUser);
}
else if (StartProcessUsingFanPagePoster == "Post Simple Message")
{
if (isPostMessageWithUrl)
{
PostOnFanPageWallWithURLAndItsImage(ref fbUser);
}
else
{
PostFanPageMessageUsingUrls(ref fbUser);
}
GlobusLogHelper.log.Info("Process completed With : " + fbUser.username);
GlobusLogHelper.log.Debug("Process completed With : " + fbUser.username);
}
else if (StartProcessUsingFanPagePoster == "Post Picture On Own Page ")
{
UploadImage(ref fbUser);
}
else if (StartProcessUsingFanPagePoster == "Post Picture On Fan Page")
{
UploadImageOnPage(ref fbUser);
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}
示例13: OneToOneCommentOnPostsUrl
public void OneToOneCommentOnPostsUrl(ref FacebookUser fbUser)
{
string Username = fbUser.username;
string Password = fbUser.password;
try
{
GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
GlobusLogHelper.log.Info("Please Wait....");
GlobusLogHelper.log.Debug("Please Wait...");
string UserId=string.Empty;
string fb_dtsg = string.Empty;
try
{
string HomePageSrc=HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/"));
UserId=Utils.getBetween(HomePageSrc,"\"USER_ID\":\"","\"");
fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(HomePageSrc);
}
catch(Exception ex)
{
}
if (QueuePostUrls.Count != 0)
{
string PostUrl = QueuePostUrls.Dequeue();
string PostResp = HttpHelper.getHtmlfromUrl(new Uri(PostUrl));
string[] containerData = Regex.Split(PostResp,"uiUfi UFIContainer");
string containerID = string.Empty;
containerID = Utils.getBetween(containerData[1], "id=\"", "\"");
string PostId = string.Empty;
if (PostUrl.Contains("posts"))
{
string[] postData = Regex.Split(PostUrl, "/");
PostId = postData[postData.Length - 1];
}
else if (PostUrl.Contains("fbid"))
{
PostId = Utils.getBetween(PostUrl, "fbid=", "&");
}
else if(string.IsNullOrEmpty(PostId))
{
string[] postData=Regex.Split(PostUrl,"/");
PostId = postData[postData.Length - 2];
}
string message = string.Empty;
if (QueueMessages.Count != 0)
{
message = QueueMessages.Dequeue();
}
else
{
message = lstMessageCollectionCommentLiker[new Random().Next(0, lstMessageCollectionCommentLiker.Count - 1)];
}
string PostCommentUrl = "https://www.facebook.com/ajax/ufi/add_comment.php";
string CommentData = "ft_ent_identifier=" + PostId + "&comment_text=" + message + "&source=2&client_id=1419601165176%3A2502448833&reply_fbid&parent_comment_id&rootid=" + containerID + "&clp=&attached_sticker_fbid=0&attached_photo_fbid=0&&&ft[tn]=[]&av=" + UserId + "&__user="+UserId+"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzElx2ubhHximmey8OdUS8zU&__req=l&fb_dtsg="+fb_dtsg+"&ttstamp=265817253854997122907682122&__rev=1543964";
string CommentResp = string.Empty;
try
{
CommentResp = HttpHelper.postFormData(new Uri(PostCommentUrl), CommentData);
}
catch (Exception ex)
{
GlobusLogHelper.log.Error(ex.Message);
}
if (CommentResp.Contains("CommentAddedActive"))
{
GlobusLogHelper.log.Info("Commented On Post Id=" + PostId + " With User =" + fbUser.username + " Message=" + message + "");
}
else
{
GlobusLogHelper.log.Info("Sorry !! Unable To Comment On Post Id=" + PostId + " With User =" + fbUser.username + " Message=" + message + "");
}
}
else
{
GlobusLogHelper.log.Info("Process Completed With Commenting On Post ");
}
int Delay = new Random().Next(minDelayFanPagePoster, maxDelayFanPagePoster);
GlobusLogHelper.log.Info("Delaying For "+Delay+" Seconds");
Thread.Sleep(Delay * 1000);
}
catch (Exception ex)
{
GlobusLogHelper.log.Error(ex.Message);
}
}
示例14: StartActionOneToOneComment
private void StartActionOneToOneComment(ref FacebookUser fbUser)
{
try
{
foreach (string PostUrl in lstFanPageUrlCollectionCommentLiker)
{
QueuePostUrls.Enqueue(PostUrl);
}
foreach (string itemMsg in lstMessageCollectionCommentLiker)
{
QueueMessages.Enqueue(itemMsg);
}
OneToOneCommentOnPostsUrl(ref fbUser);
}
catch (Exception ex)
{
GlobusLogHelper.log.Error(ex.Message);
}
}
示例15: StartActionWebSiteLiker
private void StartActionWebSiteLiker(ref FacebookUser fbUser)
{
try
{
// WebSiteLiker method
WebsiteLiker(ref fbUser);
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
}
}