Skip to content

ShinniUwU/bad-apple-ascii-api-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Great! I've added the image. Here's the updated README:

Bad Apple ASCII API

This Java API allows you to convert frames from the "Bad Apple!!" MP4 video into ASCII art. You can use this API to retrieve ASCII art representations of individual frames or stream them continuously. Additionally, an HTML file is provided to display the ASCII art in a web browser.

Bad Apple ASCII Art

Usage

Running the Server

  1. Clone this repository.
  2. Ensure you have Java installed on your system.
  3. Run the Main class to start the HTTP server.
  4. Access the API at http://localhost:8080/play.

Retrieving ASCII Art

Single Frame

You can retrieve ASCII art for a specific frame by accessing:

GET /play/{frameNumber}

Replace {frameNumber} with the desired frame number.

Streaming Frames

You can stream ASCII art frames continuously by accessing:

GET /play

This endpoint will return ASCII art for frames sequentially.

HTML Display

Included in this repository is an HTML file (index.html) that displays the ASCII art in a web browser. Open the HTML file in a browser to see the ASCII art animation.

Dependencies

This project uses the following dependencies:

  • JCodec: A library for reading and writing video/audio files in Java.
  • com.sun.net.httpserver: HTTP server included in the Java SE platform.

How It Works

The API uses JCodec to extract frames from the "Bad Apple!!" MP4 video and converts each frame into ASCII art. The ASCII art is generated by converting the pixel values of the frame's grayscale image to ASCII characters. The server streams ASCII art frames upon client requests.

Example

// Java example to retrieve ASCII art for frame number 50
String asciiArt = fetchAsciiArt(50);
System.out.println(asciiArt);

Authors

  • Hana

License

This project is licensed under the Apache License 2.0.

About

A Java-based API that generates ASCII art from the "Bad Apple.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published