This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
12306 Auto Query => A javascript snippet to help you book tickets online. | |
Copyright (C) 2011-2012 Jingqin Lynn | |
Includes jQuery | |
Copyright 2011, John Resig | |
Dual licensed under the MIT or GPL Version 2 licenses. | |
http://jquery.org/license | |
Includes Sizzle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* from Weibo http://weibo.com/haoel?from=feed&loc=at&nick=%E5%B7%A6%E8%80%B3%E6%9C%B5%E8%80%97%E5%AD%90&is_all=1#1480252617643 | |
**/ | |
days = (month === 2) ? (28 + isLeapYear) : 31 - (month - 1) % 7 % 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** 不同的方式获取结果 [InputStream -> String] : http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string | |
*/ | |
public static String getResponseFromHttpUrl(URL url) throws IOException { | |
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); | |
try { | |
InputStream in = urlConnection.getInputStream(); | |
Scanner scanner = new Scanner(in); | |
scanner.useDelimiter("\\A"); |