/// <summary> /// 获取用户发帖修改痕迹 /// </summary> /// <param name="userid"></param> /// <param name="scriptId">同一个脚本保存上一次操作痕迹</param> /// <returns></returns> public static string Get_record_mark(string userid, string scriptId) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_record_mark/" + userid.ToString() + "/" + scriptId; logger.Info("Get_record_mark url :" + url); return(HttpRequestWapper.GetData(url)); }
/// <summary> /// 是否还能继续群发贴 /// </summary> /// <param name="id"></param> /// <returns></returns> static public bool IsThread(string userid) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/is_thread/" + userid; string json = HttpRequestWapper.GetData(url); return(json.ToLower() == "true"); }
public static bool HasTask(string website) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/has_task?url=" + website; string val = HttpRequestWapper.GetData(url); logger.Info("hastask return result:" + val); return(val != ""); }
public static List <SchemaObject> Get_shcema_objects(string userId, string scriptId) { string json = HttpRequestWapper.GetData(ServerApiInvoker.APIRoot + string.Format("get_shcema_objects/{0}/{1}", userId, scriptId)); if (string.IsNullOrEmpty(json)) { return(new List <SchemaObject>()); } return(JsonConvert.DeserializeObject <List <SchemaObject> >(json)); }
static public SchemaObject GetSchemaObject(string schemaobjectId) { var url = ConfigurationManager.AppSettings["root"] + "/schemaApi/get_schema_value/" + schemaobjectId; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <SchemaObject>(json)); }
/// <summary> /// 获取需要优化的关键字列表 /// </summary> /// <returns></returns> static public List <KeywordPlan> Get_KeywordPlan(string userid) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_keywordPlan/" + userid; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <List <KeywordPlan> >(json)); }
/// <summary> /// 获取网站子模块脚本 /// </summary> /// <param name="id"></param> /// <returns></returns> static public List <ScriptObject> Get_SubModules(string websiteId) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_subModules/" + websiteId; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <List <ScriptObject> >(json)); }
static public ScriptObject Get_ScriptByNo(string no) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_scriptByNo/" + no; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <ScriptObject>(json)); }
static public ScriptObject Get_Script(string websiteId, string title) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_script_byTitle/" + websiteId + "/" + title; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <ScriptObject>(json)); }
/// <summary> /// 获取虚拟用户信息 /// </summary> /// <param name="id"></param> /// <returns></returns> static public List <MockUser> Get_MockUsers(string userId) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_mockusers/" + userId; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <List <MockUser> >(json)); }
/// <summary> /// 获取虚拟用户信息 /// </summary> /// <param name="id"></param> /// <returns></returns> static public List <WebSite> Get_TopWebsite() { var url = APIRoot + "get_top_websites"; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <List <WebSite> >(json)); }
public static List <ScriptObject> Get_thread_script_by_categories(string mockid, string schemaObjectId, string categories) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_thread_script_by_categories/" + mockid + "/" + schemaObjectId + "/" + categories; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(new List <ScriptObject>()); } return(JsonConvert.DeserializeObject <List <ScriptObject> >(json)); }
public static List <ThreadObject> Get_Thread_Worker_Object(string mockid) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_thread_script/" + mockid; string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(new List <ThreadObject>()); } return(JsonConvert.DeserializeObject <List <ThreadObject> >(json)); }
public static ThreadObject Get_Thread_Worker_Object(string mockid, string scriptId, string schemaObjectId) { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_thread_script_1/" + string.Format("{0}/{1}/{2}", mockid, scriptId, schemaObjectId); string json = HttpRequestWapper.GetData(url); if (string.IsNullOrEmpty(json)) { return(null); } return(JsonConvert.DeserializeObject <ThreadObject>(json)); }
private void InjectJQuery(Browser browser) { try { //logger.Info("InjectJQuery"); string jqueryScript = HttpRequestWapper.GetData(StringHelper.Domain + "/asserts/jqueryInject.js"); browser.InjectScript(jqueryScript); } catch (Exception ex) { Log(ex.Message); } }
public IResult Process(FakeHttpContext context, System.Runtime.InteropServices.Expando.IExpando expando) { string url = string.Format(ServerApiInvoker.Domain + "tasks/GetLoginScriptByEmail?email={0}", Identity.MockUser.Email); string script = HttpRequestWapper.GetData(url, Identity.Ticket); var model = new ModelSet(new LocalScriptRepository(script)); var currentWorker = new ActionRunnable(model); currentWorker.Run(null, true); return(new EmptyResult()); }
/// <summary> /// 通过URL获取发布类型脚本类型,包含近似度数据,不包含script内容信息 /// </summary> /// <param name="domain">二级域名</param> /// <returns></returns> public static List <ScriptObject> GetScriptObjectByUrl(string domain) { string json = HttpRequestWapper.GetData(ServerApiInvoker.APIRoot + string.Format("get_script_by_domain?domain={0}", domain)); return(JsonConvert.DeserializeObject <List <ScriptObject> >(json)); }
public static string Get_UserId() { var url = ConfigurationManager.AppSettings["root"] + "/jsonApi/get_userid"; return(HttpRequestWapper.GetData(url)); }