Updated Twitch Emote API to v3. Emote Updates are now working again.

dev
sigonasr2 7 years ago
parent df2a9d0e71
commit 8924c55247
  1. 2
      .classpath
  2. BIN
      sigIRCv2.jar
  3. 2
      src/sig/modules/TwitchModule.java
  4. 14
      src/sig/sigIRC.java

@ -7,6 +7,6 @@
<attribute name="javadoc_location" value="jar:file:/D:/Data/commons-io-2.5-javadoc.jar!/"/> <attribute name="javadoc_location" value="jar:file:/D:/Data/commons-io-2.5-javadoc.jar!/"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry exported="true" kind="lib" path="D:/Downloads/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/> <classpathentry kind="lib" path="D:/Downloads/twitch-api-wrapper-0.3-jar-with-dependencies.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

Binary file not shown.

@ -24,6 +24,7 @@ import javax.swing.SwingUtilities;
import com.mb3364.twitch.api.Twitch; import com.mb3364.twitch.api.Twitch;
import com.mb3364.twitch.api.handlers.ChannelFollowsResponseHandler; import com.mb3364.twitch.api.handlers.ChannelFollowsResponseHandler;
import com.mb3364.twitch.api.handlers.StreamResponseHandler; import com.mb3364.twitch.api.handlers.StreamResponseHandler;
import com.mb3364.twitch.api.handlers.UserResponseHandler;
import com.mb3364.twitch.api.models.ChannelFollow; import com.mb3364.twitch.api.models.ChannelFollow;
import com.mb3364.twitch.api.models.Stream; import com.mb3364.twitch.api.models.Stream;
import com.mb3364.twitch.api.models.User; import com.mb3364.twitch.api.models.User;
@ -82,7 +83,6 @@ public class TwitchModule extends Module{
CreateFollowerQueueLog(); CreateFollowerQueueLog();
} }
manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem"); manager.setClientId("o4c2x0l3e82scgar4hpxg6m5dfjbem");
getFollowers(firstTime);
/*manager.streams().get("theduckishot", new StreamResponseHandler() { /*manager.streams().get("theduckishot", new StreamResponseHandler() {
@Override @Override

@ -96,6 +96,7 @@ public class sigIRC{
public static String twitchmodule_newfollowerTextColor="255,255,255"; public static String twitchmodule_newfollowerTextColor="255,255,255";
public static int twitchmodule_newfollowerImgLogoSize=32; public static int twitchmodule_newfollowerImgLogoSize=32;
public static boolean testMode=false; public static boolean testMode=false;
public final static String TWITCHEMOTEURL = "https://static-cdn.jtvnw.net/emoticons/v1/";
public static void main(String[] args) { public static void main(String[] args) {
@ -261,8 +262,15 @@ public class sigIRC{
private static void performTwitchEmoteUpdate() { private static void performTwitchEmoteUpdate() {
try { try {
JSONObject twitchemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v2/global.json"); JSONObject twitchemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/global.json");
JSONObject emotelist = twitchemotes.getJSONObject("emotes"); for (String emotes : twitchemotes.keySet()) {
JSONObject emote = twitchemotes.getJSONObject(emotes);
int id = emote.getInt("id");
String name = emote.getString("code");
emoticons.add(new Emoticon(name, new URL(TWITCHEMOTEURL+id+"/1.0")));
}
JSONObject subemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/subscriber.json");
/*JSONObject emotelist = twitchemotes.getJSONObject("emotes");
JSONObject templatelist = twitchemotes.getJSONObject("template"); JSONObject templatelist = twitchemotes.getJSONObject("template");
String templateurl = templatelist.getString("small"); String templateurl = templatelist.getString("small");
for (String emotes : emotelist.keySet()) { for (String emotes : emotelist.keySet()) {
@ -270,7 +278,7 @@ public class sigIRC{
int id = emote.getInt("image_id"); int id = emote.getInt("image_id");
String emoteurl = templateurl.replace("{image_id}", ""+id); String emoteurl = templateurl.replace("{image_id}", ""+id);
emoticons.add(new Emoticon(emotes, new URL(emoteurl))); emoticons.add(new Emoticon(emotes, new URL(emoteurl)));
} }*/
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {

Loading…
Cancel
Save