
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
telegraph-api
Advanced tools
Telegram's Telegraph doesn't have API. Package suggest some missed handles for publishing posts on Telegraph's platform.
Terminal:
// npm
npm i telegraph-api --save
// yarn
yarn add telegraph-api
First of all you need to create new instance of telegraph-api
.
const Post = require('telegraph-api');
// without params
const firstPost = new Post();
// or with params
const secondPost = new Post({
header: 'Header',
author: 'Author',
paragraphs: ['Paragraph']
});
Then you can use public getters and setters methods that it provides:
getHeader()
- returns StringsetHeader({String})
getAuthor()
- returns StringsetAuthor({String})
getParagraphs()
- returns String[]setParagraphs({String[]})
setParagraph({String})
removeLastParagraph()
emptyHeader()
emptyAuthor()
emptyParagraphs()
publishPost({Function({Error}, {String})})
Filled constructor
const Post = require('telegraph-api');
const myPost = new Post({
header: 'Telegraph-API',
author: 'Roman Ponomarev',
paragraphs: ['First post by Telegraph-API']
});
myPost.publishPost((err, link) => {
if (err) {
throw new Error(error);
}
console.log(`Link to Post: ${link}`); // => Link to Post: http://telegra.ph/Telegraph-API-11-28
});
Empty constructor
const Post = require('telegraph-api');
const myPost = new Post();
myPost.setHeader('Telegraph-API');
myPost.setAuthor('Roman Ponomarev');
myPost.setParagraph('Second post by Telegraph-API');
console.log(myPost.getHeader()); // => Telegraph-API
console.log(myPost.getAuthor()); // => Roman Ponomarev
console.log(myPost.getParagraphs()); // => ['Second post by Telegraph-API']
myPost.publishPost((err, link) => {
if (err) {
throw new Error(error);
}
console.log(`Link to Post: ${link}`); // => Link to Post: http://telegra.ph/Telegraph-API-11-28-2
});
FAQs
API for Telegram's Telegraph
The npm package telegraph-api receives a total of 2 weekly downloads. As such, telegraph-api popularity was classified as not popular.
We found that telegraph-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.