import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.IOUtils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import org.json.simple.parser.ParseException;

public class ResourceFetcher {

    public static String getDescription(String url) {

        String Descripcion = "http://api.screenshotmachine.com/?key=4c2f50&size=E&format=JPG&cacheLimit=0&timeout=0&cacheLimit=14&url=" + url;

            return Descripcion;
    }

    public static String getQrCodeURL(String url) {

        String TheUrl = "http://api.qrserver.com/v1/create-qr-code/?data=" + url + "&size=150x150&color=0-0-0&bgcolor=FFFF00&format=png";
            return TheUrl;
    }


    public static String json_to_java(String ip){


        String Country_url = "http://api.db-ip.com/v2/7496a2baeeff5630344751043641127d7b0cf062/" + ip;

                try {
                    String genreJson = IOUtils.toString(new URL(Country_url));
                    JSONObject genreJsonObject = (JSONObject) JSONValue.parseWithException(genreJson);

                    // get the data
                    JSONArray countryName;
                    countryName = (JSONArray) genreJsonObject.get("countryName");
                } catch (IOException | ParseException e) {
                    e.printStackTrace();
                }

                return Country_url;
<<<<<<< Updated upstream
    }
=======
            }


>>>>>>> Stashed changes

    public static String flag(String ip) {

        String link_flag= "https://ipfind.co/flags?ip="+ip+"&auth=d9cec36e-01af-4d43-9452-e5cb08eab33e";

        return link_flag;
    }
    public static String getCountryFromIP(String ip)
    {
        return "Dom Rep";
    }


}
@@ -778,17 +778,16 @@
 g ip)%7B%0A%0A
-%0A
         
@@ -898,22 +898,14 @@
     
-    
 try %7B%0A
-    
     
@@ -975,20 +975,16 @@
 _url));%0A
-    
         
@@ -1091,20 +1091,16 @@
         
-   
- 
 // get t
@@ -1107,20 +1107,16 @@
 he data%0A
-    
         
@@ -1162,20 +1162,16 @@
         
-   
- 
 countryN
@@ -1236,20 +1236,16 @@
         
-    
 %7D catch 
@@ -1295,20 +1295,16 @@
         
-  
-  
 e.printS
@@ -1328,20 +1328,16 @@
         
-    
 %7D%0A%0A     
@@ -1335,32 +1335,24 @@
  %7D%0A%0A        
-  
-      
 return Count
@@ -1363,86 +1363,13 @@
 rl;%0A
-%3C%3C%3C%3C%3C%3C%3C Updated upstream%0A    %7D%0A=======%0A            %7D%0A%0A%0A%3E%3E%3E%3E%3E%3E%3E Stashed changes
+    %7D
 %0A%0A  

Resolve merge conflict