public static String matchMovieFromRT(String jsonResponse, Movie movie)
            throws JSONException
    {
        JSONObject jsonObject = new JSONObject(jsonResponse);
        JSONArray jsonArray = jsonObject.getJSONArray("movies");
        for (int i = 0; i < jsonArray.length(); i++)
        {
            JSONObject resultMovie = jsonArray.getJSONObject(i);
            int year = resultMovie.getInt("year");
            if (resultMovie.has("alternate_ids"))
            {
                int id = resultMovie.getJSONObject("alternate_ids").getInt("imdb");
                if (id == movie.imdbId)
                {
                    JSONObject links = resultMovie.getJSONObject("links");
                    return links.getString("self");
                }
            }
            else
            {
                String title = resultMovie.getString("title");
                title = title.trim();
                if ((year == movie.year) && title.contains(movie.imdbTitle))
                {
                    JSONObject links = resultMovie.getJSONObject("links");
                    return links.getString("self");
                }
            }

        }
        return null;
    }