Load json
FossilOrigin-Name: ec9d16966d31ba7a95553a2a854cfc420d3aca600b0a60f48912f59b8c440e51
This commit is contained in:
parent
940138f370
commit
385364781f
4 changed files with 12 additions and 2 deletions
|
@ -13,6 +13,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MASTODONT_FETCH_H
|
||||
#define MASTODONT_FETCH_H
|
||||
#include <cjson/cJSON.h>
|
||||
#include <mastodont_types.h>
|
||||
|
||||
|
@ -26,4 +28,5 @@ void mastodont_fetch_results_cleanup(struct mastodont_fetch_results* res);
|
|||
int mastodont_fetch_curl(mastodont_t* mstdnt,
|
||||
char* url,
|
||||
struct mastodont_fetch_results* results);
|
||||
/*cJSON* mastodont_call_json();*/
|
||||
|
||||
#endif /* MASTODONT_FETCH_H */
|
||||
|
|
|
@ -24,6 +24,7 @@ typedef struct mastodont {
|
|||
CURL* curl;
|
||||
} mastodont_t;
|
||||
|
||||
/* FIXME */
|
||||
struct mstdnt_response {
|
||||
char* data;
|
||||
size_t size;
|
||||
|
|
1
src/.#timeline.c
Symbolic link
1
src/.#timeline.c
Symbolic link
|
@ -0,0 +1 @@
|
|||
nekobit@toomuchram.2058:1642690987
|
|
@ -40,8 +40,13 @@ int mastodont_timeline_public(mastodont_t* data,
|
|||
|
||||
res = mastodont_fetch_curl(data, "/api/v1/timelines/public", &results);
|
||||
|
||||
printf("Size of data: %zd\n", results.size);
|
||||
cJSON* parse = cJSON_Parse(results.response);
|
||||
|
||||
|
||||
|
||||
/* Cleanup */
|
||||
free:
|
||||
cJSON_Delete(parse);
|
||||
mastodont_fetch_results_cleanup(&results);
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Reference in a new issue