Changeset 28488 in osm


Ignore:
Timestamp:
2012-07-14T12:38:35+02:00 (12 years ago)
Author:
simon04
Message:

JOSM/wikipedia: fix #josm7856.

Use HTTP POST to status check long categories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java

    r28486 r28488  
    33
    44import java.io.IOException;
     5import java.io.OutputStreamWriter;
    56import java.io.UnsupportedEncodingException;
    67import java.net.URL;
     8import java.net.URLConnection;
    79import java.net.URLDecoder;
    810import java.net.URLEncoder;
     
    9496        Map<String, Boolean> status = new HashMap<String, Boolean>();
    9597        if (!articleNames.isEmpty()) {
    96             final String url = "http://toolserver.org/~master/osmjson/getGeoJSON.php?action=check"
    97                     + "&lang=" + wikipediaLang
    98                     + "&articles=" + encodeURL(Utils.join(",", articleNames));
     98            final String url = "http://toolserver.org/~simon04/getGeoJSON.php?action=check"
     99                    + "&lang=" + wikipediaLang;
    99100            System.out.println("Wikipedia: GET " + url);
    100101
    101102            try {
    102                 final Scanner scanner = new Scanner(new URL(url).openStream()).useDelimiter("\n");
     103                URLConnection connection = new URL(url).openConnection();
     104                connection.setDoOutput(true);
     105
     106                OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
     107                out.write("articles=" + encodeURL(Utils.join(",", articleNames)));
     108                out.close();
     109
     110
     111                final Scanner scanner = new Scanner(connection.getInputStream()).useDelimiter("\n");
    103112                while (scanner.hasNext()) {
    104113                    //[article]\t[0|1]
Note: See TracChangeset for help on using the changeset viewer.