| The udger Cloud parser v.2 is designed to be quick to deploy and provide fast, accurate and consistent results. (since 2010) It's easy to use
API provides the following informationUdger API provides three types of information, three types of methods.
Example usevar ACCESSKEY = "XXXXXX"; // Your access key var UASSTRING = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api.udger.com/parse"); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; string postData ="accesskey=" + ACCESSKEY + "&ua=" + UASSTRING; byte[] bytes = Encoding.UTF8.GetBytes(postData); request.ContentLength = bytes.Length; Stream requestStream = request.GetRequestStream(); requestStream.Write(bytes, 0, bytes.Length); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream); var result = reader.ReadToEnd(); String ACCESSKEY = "XXXXXX"; // Your access key String UASSTRING = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"; URL url; HttpURLConnection connection = null; try { url = new URL("http://api.udger.com/parse"); connection = (HttpURLConnection)url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); connection.setUseCaches (false); connection.setDoInput(true); connection.setDoOutput(true); //Send request DataOutputStream wr = new DataOutputStream (connection.getOutputStream ()); wr.writeBytes ("accesskey=" + ACCESSKEY + "&ua=" + UASSTRING); wr.flush (); wr.close (); //Get Response InputStream is = connection.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(is)); String line; StringBuffer response = new StringBuffer(); while((line = rd.readLine()) != null) { response.append(line); response.append('\r'); } rd.close(); String result = response.toString(); } catch (Exception e) { e.printStackTrace(); } finally { if(connection != null) { connection.disconnect(); } } use LWP::UserAgent; my $ACCESSKEY = "XXXXXX"; #// Your access key my $UASSTRING = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"; # Crete an UserAgent my $ua = LWP::UserAgent->new(); # set POST variables my %form; $form{'accesskey'}=$ACCESSKEY; $form{'ua'}=$UASSTRING; # Create a request my $response = $ua->post( "http://api.udger.com/parse", \%form ); # get a response back my $content = $response->as_string(); print $content; $accesskey = "XXXXXX"; // Your access key $uasstring = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"; $data = array('accesskey' => $accesskey, 'ua' => $uasstring); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = @file_get_contents("http://api.udger.com/parse", false, $context); import json import pprint try: from urllib.parse import urlencode from urllib.request import urlopen except ImportError: from urllib import urlencode, urlopen # Python 2 post_data = { 'accesskey': 'XXXXXX', 'ua': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', } response_bytes = urlopen( 'http://api.udger.com/parse', urlencode(post_data).encode('UTF-8'), ).read() data_dict = json.loads( response_bytes.decode('UTF-8'), ) pprint.pprint(data_dict) |