This file contains hidden or 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
| +(NSString*)stringByURLEncodingStringParameter:(NSString*)originalStr | |
| { | |
| // NSURL's stringByAddingPercentEscapesUsingEncoding: does not escape | |
| // some characters that should be escaped in URL parameters, like / and ?; | |
| // we'll use CFURL to force the encoding of those | |
| // | |
| // We'll explicitly leave spaces unescaped now, and replace them with +'s | |
| // | |
| // Reference: [url]http://www.ietf.org/rfc/rfc3986.txt[/url] | |
This file contains hidden or 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
| + (UIImage *) imageForSelectedBlue { | |
| CGRect rect = CGRectMake(0, 0, 10, 10); | |
| UIGraphicsBeginImageContext(rect.size); | |
| CGContextRef context = UIGraphicsGetCurrentContext(); | |
| size_t num_locations = 2; | |
| CGFloat locations[2] = { 0.0, 1.0 }; | |
| CGFloat components[8] = { 0.021, 0.548, 0.962, 1.000, 0.008, 0.364, 0.900, 1.000 }; | |
| CGColorSpaceRef rgbColorspace = CGColorSpaceCreateDeviceRGB(); |
This file contains hidden or 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
| NSString *encode_feature_name = [feature_name stringByAddingPercentEscapesUsingEncoding: | |
| CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000)]; | |
| NSString *feature_str = [[NSString alloc] initWithFormat:@"&s_review=%@", encode_feature_name]; | |
| //NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); | |
| //NSData *data = [[[NSString alloc] initWithFormat:@"&s_review=%@", feature_name] dataUsingEncoding:NSUTF8StringEncoding];: |
This file contains hidden or 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
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| # auther: jeswang | |
| # finished time: 2011.7.29 | |
| import os | |
| import stat | |
| import urllib2 | |
| import urllib | |
| import time,datetime |
This file contains hidden or 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
| # coding=utf-8 | |
| from BeautifulSoup import * | |
| import sys, httplib | |
| import re | |
| import os | |
| import urllib,urllib2 | |
| def getMVName(url): | |
| c=urllib2.urlopen(url) |
This file contains hidden or 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
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| from BeautifulSoup import * | |
| import urllib2 | |
| import codecs | |
| def urlToTxt(url): | |
| bookUrl = url | |
| suffix = "html" |