Exemplo n.º 1
0
        public static string AddItemToXuanpinku(string groupid, System.Collections.ArrayList itemids, ref CookieContainer alimamacc)
        {
            string result    = "";
            string url       = "http://pub.alimama.com/favorites/item/batchAdd.json";
            string tbtoken   = Alimama.GetTbToken(alimamacc);
            string encodeids = "";

            for (int i = 0; i < itemids.Count; i++)
            {
                if (i + 1 != itemids.Count)
                {
                    encodeids += itemids[i] + "%2C";
                }
                else
                {
                    encodeids += itemids[i];
                }
            }

            string poststr = "groupId=" + groupid + "&itemListStr=" + encodeids + "&t=" + HttpHelper1.GetTicks() + "&_tb_token_=" + tbtoken + "&pvid=10_118.145.0.220_431_1496130793991";
            string refer   = "http://pub.alimama.com/promo/search/index.htm?q=1&t=" + HttpHelper1.GetTicks();

            result = HttpHelper1.SendDataByPost(url, poststr, refer, ref alimamacc);
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 阿里妈妈搜索店铺
        /// </summary>
        /// <param name="query"></param>
        /// <param name="pv_id"></param>
        /// <param name="alimamacc"></param>
        /// <returns></returns>
        public static AlimamaSearchShopData GetSearchData(string query, string pv_id, CookieContainer alimamacc)
        {
            AlimamaSearchShopData alimamasearchdata = new AlimamaSearchShopData();
            string tbtoken = Alimama.GetTbToken(alimamacc);
            string url     = "http://pub.alimama.com/shopsearch/shopList.json?spm=a2320.7388781.a214tr8.d006.QkMiw1&q=" + HttpUtility.UrlEncode(query) + "&toPage=1&perPagesize=40&t=" + HttpHelper1.GetTicks() + "&pvid=" + pv_id + "&_tb_token_=" + tbtoken + "&_input_charset=utf-8";
            string result  = HttpHelper1.SendDataByGET(url, ref alimamacc);

            alimamasearchdata = Newtonsoft.Json.JsonConvert.DeserializeObject <AlimamaSearchShopData>(result);
            return(alimamasearchdata);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 创建选品库
        /// </summary>
        /// <param name="title">选品库名称</param>
        /// <param name="alimamacc"></param>
        /// <returns>选品库ID</returns>
        public static string CreatXuanpinku(string title, ref CookieContainer alimamacc)
        {
            string result      = "";
            string groupId     = "";
            string url         = "http://pub.alimama.com/favorites/group/save.json";
            string tbtoken     = Alimama.GetTbToken(alimamacc);
            string encodetitle = HttpUtility.UrlEncode(title);
            string poststr     = "groupTitle=" + encodetitle + "&groupType=1&t=" + HttpHelper1.GetTicks() + "&_tb_token_=" + tbtoken + "&pvid=";
            string refer       = "http://pub.alimama.com/promo/search/index.htm?q=1&t=" + HttpHelper1.GetTicks();

            result = HttpHelper1.SendDataByPost(url, poststr, refer, ref alimamacc);
            HttpHelper1.GetStringInTwoKeyword(result, ref groupId, "{\"data\":{\"data\":", "},\"", 0);
            return(groupId);
        }