Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this library still work? #16

Closed
sergeybok opened this issue Jan 11, 2020 · 0 comments
Closed

Does this library still work? #16

sergeybok opened this issue Jan 11, 2020 · 0 comments

Comments

@sergeybok
Copy link

Hi, I am running the following code based on the last bit from the documentation, and it's saving empty images, also when I follow the URL that gets created it's a blank page. Looking at the dates it's from 1.5 years ago, so I was wondering if bitmoji changed their APIs or am I not using the library correctly?

const fs = require('fs');
const https = require('https');
const libmoji = require('libmoji');


function saveImageToDisk(url, localPath) {
    var fullUrl = url;
    var file = fs.createWriteStream(localPath);
    var request = https.get(url, function(response) {
        response.pipe(file);
    });
};

let comicId = libmoji.getComicId(libmoji.randTemplate(libmoji.templates));
let avatarId = libmoji.getAvatarId("https://render.bitstrips.com/v2/cpanel/8968038-316830037_35-s5-v1.png?transparent=1&palette=1");
let outfit = libmoji.randOutfit(libmoji.getOutfits(libmoji.randBrand(libmoji.getBrands("male"))));

const bitmojiUrl = libmoji.buildRenderUrl(comicId,avatarId,1,2,outfit);
console.log(bitmojiUrl);

saveImageToDisk(bitmojiUrl, 'sample.jpg');
saveImageToDisk(bitmojiUrl, 'sample.png');

Thanks for any help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant