Code Monkey home page Code Monkey logo

aghpb.c's Introduction

⚫ aghpb.c 📚

C API wrapper for the anime girls holding programming books API


Note

This is part of my aghpb api wrapper challenge where I attempt to write an api wrapper in every language possible. So yes expect spaghetti code as it will be my first time writing in these languages. Although I'm 100% open to improvements and corrections so feel free to contribute anything. Other languages I've done

Install

idk, you guys are C devs you should know this, git clone the mfing repo and figure it out yourself.

I threw in a makefile template so I believe you can use that:

git clone https://github.com/THEGOLDENPRO/aghpb.c
cd aghpb.c
make

but make sure you have libcurl installed.

This is the command I used to compile the library together with my own C program:

gcc -o file_name file_name.c aghpb.c -I . -lcurl

This is assuming aghpb.h & aghpb.c are in the same folder as your main program.

Examples

You can also run examples like so:

cp ./examples/random.c ./book_generator.c
gcc -o book_generator ./book_generator.c aghpb.c -I . -lcurl && ./book_generator

make sure to cd aghpb.c

This is how you may retrieve a random anime girl holding a programming book:

#include <stdio.h>
#include "aghpb.h" // import this bitch

int main() {
    // Create a file to store this mfing programming book.
    FILE *file = fopen("./anime_girl.png", "w");

    // Once we pass file into random the function *should... just maybe...* write to it. 
    // (There's possibly a slight change of it blowing up.)
    AGHPB_Book book* = aghpb_random(file);

    printf("Name: %s\n", book->name);
    printf("Category: %s\n", book->category);
    printf("Date Added: %s\n", book->date_added);

    free(book);
    fclose(file);
    // Hurry! Now you should have a picture of an anime girl holding a programming book (please kill me it's 1AM rn and I'M GOING INSANE FROM WRITING C CODE!!! AHHHHHHHHHHH)

    return 0;
}

You can also retrieve specific categories of anime girls holding programming books like so:

AGHPB_Book book = aghpb_random_category(file, "c");

This is how you may retrieve a list of available categories:

#include <stdio.h>
#include "aghpb.h" // import this bitch

int main() {
    char* categories = aghpb_categories();

    printf("--> %s", categories);

    return 0;
}

Made using my API at 👉 https://api.devgoldy.xyz/aghpb/v1/

aghpb.c's People

Contributors

arkaeriit avatar thegoldenpro avatar emretech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.