From 414a31e711f74a83d35934ae563ae112c69a7ead Mon Sep 17 00:00:00 2001 From: Nekobit Date: Sat, 16 Sep 2023 23:48:30 -0400 Subject: [PATCH] Start gg started --- Makefile | 2 +- gg.c | 132 +++++++++++++++++++++++++++++++++++++++ gg.h | 22 +++++++ home.c | 37 +++-------- http.c | 32 ++++++++++ http.h | 16 +++++ main.c | 18 ++++-- minilauncher4slippi.cfg | 1 + start.gg - Get Token.jpg | Bin 0 -> 87126 bytes 9 files changed, 225 insertions(+), 35 deletions(-) create mode 100644 gg.c create mode 100644 gg.h create mode 100644 http.c create mode 100644 http.h create mode 100644 start.gg - Get Token.jpg diff --git a/Makefile b/Makefile index 4bc77d9..f8f6dbf 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC=cc CFLAGS=--std=c99 -g `pkg-config --cflags efl ecore elementary libusb-1.0` `sdl2-config --cflags` LDFLAGS=`pkg-config --libs efl ecore elementary libusb-1.0` `sdl2-config --libs` -lcjson -OBJS=main.o replay.o home.o input.o +OBJS=main.o replay.o home.o input.o http.o gg.o minilauncher4slippi: $(OBJS) $(CC) -o minilauncher4slippi $(OBJS) $(LDFLAGS) diff --git a/gg.c b/gg.c new file mode 100644 index 0000000..98d66c2 --- /dev/null +++ b/gg.c @@ -0,0 +1,132 @@ +#include +#include "gg.h" +#include "http.h" + +Evas_Object* tab_gg = NULL; +static Evas_Object* tab_gg_sidebar; +static Evas_Object* tab_gg_content; +extern char* start_gg_api; + +static void +_gg_sidebar_cb(void *_data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object** data = _data; + //update_tab(*data); +} + +static Eina_Bool +_gg_scrape_result(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info) +{ + Ecore_Con_Event_Url_Complete* ev = event_info; + struct memory_chunk* dd = ecore_con_url_data_get(ev->url_con); + +#define magiccode "script id=\"__NEXT_DATA__\" type=\"application/json\">" + char* start_json = strstr(dd->data, magiccode); + if (!start_json) + return EINA_FALSE; // Some error + start_json += sizeof(magiccode) - 1; + + char* end_json = strstr(start_json, "