@@ -0,0 +1,2020 @@
+import java.io.IOException;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0A%0Aimport okhttp3.HttpUrl;%0Aimport okhttp3.MediaType;%0Aimport okhttp3.OkHttpClient;%0Aimport okhttp3.Request;%0Aimport okhttp3.RequestBody;%0Aimport okhttp3.Response;%0A%0Apublic class makeGif %7B%0A%09// Generate GIF from a set of static image%0A%09// https://pixlab.io/#/cmd?id=makegif for additional information.%0A%09%0A    static OkHttpClient client = new OkHttpClient();%0A    %0A    public static final MediaType JSON = MediaType.parse(%22application/json; charset=utf-8%22);%0A%0A%09public static void main(String%5B%5D args) throws IOException, JSONException %7B%0A%09%09%0A%09%09HttpUrl httpUrl = new HttpUrl.Builder()%0A                .scheme(%22https%22)%0A                .host(%22api.pixlab.io%22)%0A                .addPathSegment(%22makegif%22).build();%0A%09%09%0A%09%09JSONArray Obj = new JSONArray();%0A%09%09Obj.put(new JSONObject().append(%22img%22, %22https://cdn1.iconfinder.com/data/icons/human-6/48/266-512.png%22));%0A%09%09Obj.put(new JSONObject().append(%22img%22, %22https://cdn1.iconfinder.com/data/icons/human-6/48/267-512.png%22));%0A%09%09Obj.put(new JSONObject().append(%22img%22, %22https://cdn1.iconfinder.com/data/icons/human-6/48/278-512.png%22));%0A%09%09Obj.put(new JSONObject().append(%22img%22, %22https://cdn1.iconfinder.com/data/icons/human-6/48/279-512.png%22));%0A%09%09%0A%09%09JSONObject jObj = new JSONObject();%0A%09%09jObj.append(%22key%22, %22Pix_Key%22);%0A%09%09//jObj.append(%22frames%22, Obj.toString());%0A%09%09%0A%09%09RequestBody body = RequestBody.create(JSON, jObj.toString());%0A%0A%09%09Request requesthttp = new Request.Builder()%0A                .url(httpUrl)%0A                .post(body)%0A                .addHeader(%22content-type%22, %22application/json; charset=utf-8%22)%0A%0A                .build();%0A%09%09Response response = client.newCall(requesthttp).execute();%0A%0A%09%09JSONObject jResponse = new JSONObject(response.body().string());%0A%09%09if (jResponse.getInt(%22status%22) != 200) %7B %0A%09%09%09System.out.println(%22Error :: %22 + jResponse.getString(%22error%22));%0A%09%09%09System.exit(1);%0A%09%09%7Delse %7B%0A%09%09%09System.out.println(%22GIF location: %22+ jResponse.getString(%22link%22));%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Generate GIF from a set of static image