A library that can be used to create bots for social media such as Facebook.
To use the ImageManager class you must have ImageCmd compiled in the root folder of your project.
ImageCmd: https://github.com/TheBotBlog/ImageCmd
auto service = new FacebookService("PAGE_ID", "TOKEN");
auto post = service.createPost("MESSAGE");
auto post = service.createPost("MESSAGE", "IMAGE_URL");
auto post = service.retrievePost("POST_ID", true);
post.updateLinkAndPhoto();
auto comments = post.readComments();
while (post.hasMoreComments)
{
comments ~= post.readNextComments();
}
For comments just switch the post out with the comment object.
post.updateReacts();
foreach (loveReact; post.loveReacts)
{
// ...
}
For comments just switch the post out with the comment object.
foreach (comment; comments)
{
comment.updateReacts();
foreach (loveReact; comment.loveReacts)
{
// ...
}
}
The below examples require ImageCmd
auto imageManager = new ImageManager("SOURCE_IMAGE_PATH", "finalized%s.png");
//The final image will be named "finalized.png"
imageManager.rotate180();
imageManager.drawImage("IMAGE_PATH", X, Y, WIDTH, HEIGHT);
imageManager.drawRectangle(X, Y, WIDTH, HEIGHT, Color.rgb(0,0,0), true);
{
auto textOptions = new TextOptions;
textOptions.fontName = "Verdana";
textOptions.fontSize = 42.0;
textOptions.color = Color.rgb(255, 255, 255);
textOptions.rect = new Rectangle;
textOptions.rect.x = 0;
textOptions.rect.y = 0;
textOptions.rect.fixedWidth = true;
textOptions.rect.fixedHeight = true;
textOptions.centerText = true;
imageManager.drawText("The text to draw", textOptions);
}
imageManager.inverseColors();
imageManager.turnBlackAndWhite();
imageManager.finalize();