Subversion Repositories SmartDukaan

Rev

Rev 15899 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15899 Rev 16088
Line 50... Line 50...
50
    public static final String SELLER_HOME = "seller.flipkart.com";
50
    public static final String SELLER_HOME = "seller.flipkart.com";
51
    public static final String USER_AGENT = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63";
51
    public static final String USER_AGENT = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63";
52
    public static final HttpClient client = new DefaultHttpClient();
52
    public static final HttpClient client = new DefaultHttpClient();
53
    
53
    
54
    private static String UPDATE_PRICE_ON_FK;
54
    private static String UPDATE_PRICE_ON_FK;
55
    
55
    /*
56
    static{
56
    static{
57
        try {
57
        try {
58
            UPDATE_PRICE_ON_FK = ConfigClient.getClient().get("sync_price_on_marketplace");
58
            UPDATE_PRICE_ON_FK = ConfigClient.getClient().get("sync_price_on_marketplace");
59
        } catch (ConfigException e) {
59
        } catch (ConfigException e) {
60
            logger.error("Unable to get sync prices on marketplace", e);
60
            logger.error("Unable to get sync prices on marketplace", e);
Line 67... Line 67...
67
		mailer = new GmailUtils();
67
		mailer = new GmailUtils();
68
		//sendTo = new String[]{"manish.sharma@shop2020.in"};
68
		//sendTo = new String[]{"manish.sharma@shop2020.in"};
69
		sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "manish.sharma@shop2020.in", "rajneesh.arora@shop2020.in",
69
		sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "manish.sharma@shop2020.in", "rajneesh.arora@shop2020.in",
70
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
70
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
71
				"yukti.jain@shop2020.in","yatin.singh@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","anikendra.das@shop2020.in"};
71
				"yukti.jain@shop2020.in","yatin.singh@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","anikendra.das@shop2020.in"};
72
    }
72
    }*/
73
    
73
    
74
    public static String getCsrfValue() throws ClientProtocolException, IOException, JSONException{
74
    public static String getCsrfValue() throws ClientProtocolException, IOException, JSONException{
75
		HttpResponse response;
75
		HttpResponse response;
76
		
76
		
77
		BufferedReader rd= null;
77
		BufferedReader rd= null;
Line 106... Line 106...
106
		return csrfVal;
106
		return csrfVal;
107
	}
107
	}
108
 
108
 
109
 
109
 
110
    public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
110
    public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
111
        
111
        /*
112
        if (!Boolean.valueOf(UPDATE_PRICE_ON_FK)){
112
        if (!Boolean.valueOf(UPDATE_PRICE_ON_FK)){
113
            return true;
113
            return true;
114
        }
114
        }*/
115
 
115
 
116
        HttpGet get_new;
116
        HttpGet get_new;
117
        BufferedReader rd= null;
117
        BufferedReader rd= null;
118
		get_new = new HttpGet("https://seller.flipkart.com/");
118
		get_new = new HttpGet("https://seller.flipkart.com/");
119
		get_new.addHeader("Host","seller.flipkart.com");
119
		get_new.addHeader("Host","seller.flipkart.com");
Line 159... Line 159...
159
        String data = "{\"refiners\":{\"sku_id\":[\""+skuAtFlipkart+"\"]},\"verticalGroup\":{},\"sellerId\":\""+SELLER_ID+"\",\"pageSize\":10,\"pageNumber\":1,\"state\":\"LIVE\",\"_csrf\":\""+csrfVal+"\"}";
159
        String data = "{\"refiners\":{\"sku_id\":[\""+skuAtFlipkart+"\"]},\"verticalGroup\":{},\"sellerId\":\""+SELLER_ID+"\",\"pageSize\":10,\"pageNumber\":1,\"state\":\"LIVE\",\"_csrf\":\""+csrfVal+"\"}";
160
        //String data = "{\"refiners\":{\"sku_id\":[\"12442\"]},\"verticalGroup\":{},\"sellerId\":\"m2z93iskuj81qiid\",\"pageSize\":10,\"pageNumb
160
        //String data = "{\"refiners\":{\"sku_id\":[\"12442\"]},\"verticalGroup\":{},\"sellerId\":\"m2z93iskuj81qiid\",\"pageSize\":10,\"pageNumb
161
        logger.info(data);
161
        logger.info(data);
162
        //HttpGet get_new = new HttpGet("https://seller.flipkart.com/dashboard/som/new_order_items?status=on_hold%2Capproved.payment_approved&sort=confirm_by_date&page="+i+"&page_size=100&_="+time);
162
        //HttpGet get_new = new HttpGet("https://seller.flipkart.com/dashboard/som/new_order_items?status=on_hold%2Capproved.payment_approved&sort=confirm_by_date&page="+i+"&page_size=100&_="+time);
163
        HttpPost httppost = new HttpPost("https://seller.flipkart.com/createproduct/getproductrowsforstate?sellerId=m2z93iskuj81qiid");
163
        HttpPost httppost = new HttpPost("https://seller.flipkart.com/createproduct/getproductrowsforstate?sellerId=m2z93iskuj81qiid");
164
        httppost.addHeader("Cookie",COOKIE+";  T=TI143676574953728283468652963707792772000507925594940705902272051229; s_ppv=20; __utma=19769839.1606715935.1436765752.1436776227.1436781309.4; __utmc=19769839; s_cc=true; s_ch_list=%5B%5B'Affiliates'%2C'1436765752631'%5D%2C%5B'Direct%2528No%2520referrer%2529'%2C'1436772820483'%5D%2C%5B'Affiliates'%2C'1436776225673'%5D%2C%5B'Affiliates'%2C'1436781310176'%5D%5D; s_sq=%5B%5BB%5D%5D; SN=2.VI867C5C7412964CF699334DBD9EF6DE52.SIA588536C11BE409DA6EDA6421E4C553A.VS143678130317178984193.1436781310; VID=2.VI867C5C7412964CF699334DBD9EF6DE52.1436781310.VS143678130317178984193; NSID=2.SIA588536C11BE409DA6EDA6421E4C553A.1436781310.VI867C5C7412964CF699334DBD9EF6DE52; is_login=true; sellerId=m2z93iskuj81qiid; __utma=143439159.1310095091.1436782302.1436782302.1436782302.1; __utmb=143439159.3.9.1436782338363; __utmc=143439159; __utmz=143439159.1436782302.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); km_lv=x; _ga=GA1.2.1310095091.1436782302; _mkto_trk=id:021-QVV-957&token:_mch-flipkart.com-1436782303258-56348; kvcd=1436783491524; km_vs=1; km_ai=m2z93iskuj81qiid; km_ni=m2z93iskuj81qiid; km_uq=");
164
        httppost.addHeader("Cookie",COOKIE+";  __gads=ID=dfe0374cf04d1576:T=1381304511:S=ALNI_Ma2TpDrlF9_amkoqp3MOYJBaFAOUg; km_lv=x; T=TI138130450866706710769873257251497444628820234222703981199700765991; __CG=u%3A6208250296506778000%2Cs%3A2098853214%2Ct%3A1419058011787%2Cc%3A1%2Ck%3Awww.flipkart.com/24/24/76%2Cf%3A0%2Ci%3A1; S=d1t13CXEVURPbRn%2FTAlMG9iwwwBWoS%2FUUixPxuJkY6W8pdfcWEzMG07x3EBPSRtlGHPdclpSYHdyFGacGJ0K01qpxtQ%3D%3D; __sonar=6631097455123118581; s_ch_list=%5B%5B'Affiliates'%2C'1436780663582'%5D%2C%5B'Direct%2528No%2520referrer%2529'%2C'1437154172975'%5D%5D; __utma=19769839.1156779613.1390806906.1436780662.1437154173.31; __utmz=19769839.1436780662.30.17.utmcsr=mobilehotindia.com|utmccn=(referral)|utmcmd=referral|utmcct=/r.html; VID=2.VIB4C4C187B63B4436AAE42944FD9BE1C9.1437389520.VS143738952083130426084; NSID=2.SI2B008083CC2145FFB103D6E76CDB343C.1437389520.VIB4C4C187B63B4436AAE42944FD9BE1C9;  SN=2.VIB4C4C187B63B4436AAE42944FD9BE1C9.SI2B008083CC2145FFB103D6E76CDB343C.VS143738952083130426084.1437389520; __utmt=1; _gat=1; is_login=true; sellerId=m2z93iskuj81qiid; __utma=143439159.1156779613.1390806906.1435740037.1437454247.95; __utmb=143439159.7.9.1437454350458; __utmc=143439159; __utmz=143439159.1390806906.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.2.1156779613.1390806906; _mkto_trk=id:021-QVV-957&token:_mch-flipkart.com-1434970574990-64308; kvcd=1437454400320; km_vs=1; km_ai=m2z93iskuj81qiid; km_ni=m2z93iskuj81qiid; km_uq=1437454437%20%2Fe%3Fcategory%3Dlistings%26label%3Dsearch%2520sku_id%2520in%2520my%2520listings%26_n%3Dsearch%2520listings%26_k%3D24a3ad2b74ad481059076b2c4d300b978b2c7adb%26_p%3Dm2z93iskuj81qiid%26_t%3D1437454437");
165
        httppost.addHeader("User-agent", USER_AGENT);
165
        httppost.addHeader("User-agent", USER_AGENT);
166
        httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
166
        httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
-
 
167
        httppost.addHeader("fk-csrf-token",csrfVal);
167
 
168
 
168
        StringEntity input = null;
169
        StringEntity input = null;
169
        input = new StringEntity(data);
170
        input = new StringEntity(data);
170
        input.setContentType("application/json");
171
        input.setContentType("application/json");
171
        httppost.setEntity(input);
172
        httppost.setEntity(input);