Skip to content

Instantly share code, notes, and snippets.

View joohee's full-sized avatar

Joohee Kang joohee

  • Korea
View GitHub Profile
@joohee
joohee / ios_json_xml_html_parse.m
Created June 23, 2013 01:35
JSON, XML, Html Parse of iOS
//JSON example
// - receiedData : {"feed" : {"title" : "my title", "content" : "my content"}} 인 경우
- (void) startJsonParse(NSData *receivedData)
{
NSError* error;
NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:receivedData options:kNilOptionserror:&error];
NSArray *array = [[dictionary objectForKey:@"feed"] objectForKey:@"entry"];
@joohee
joohee / nokogiri_encoding.rb
Last active December 18, 2015 05:29
nokogiri encoding example (include Hangul)
# TODO : redirect link 호출 및 text data 긁어오기
require 'net/http'
require 'nokogiri'
require 'sanitize'
@newsfeed = Newsfeed.new
//...
@newsfeed.link = "http://openapi.naver.com/l?AAAD2M2w6DIAxAv6Y+GgRl8uCD29xvLFjKNFNwyC7+/TBZljTNOSdpH08KWwPdEdoKVA3ded91Cd0J2kOCLG4LNY7ea3anrVGWS131CpU10khkJRqtLdNYUU1SZEMg2wwxLiBa4Jc06+JDXPP9Re70i0KOfv73BKMz9Mnd4EBcUEe6+bCBOM9TD1xivCXej5PM3iQJpE0Sb+2IdB33VBSHVHSII06/xBjjouRKqS+DV2bW5AAAAA=="
response = Net::HTTP.get_response(URI.parse(@newsfeed.link))
response_redirect = Net::HTTP.get_response(URI.parse(response['location']))