This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rp = require('request-promise-native'); | |
async function getTzId(apiKey) { | |
const response = await rp({ | |
url: `https://onlinesim.ru/api/getNum.php?apikey=${apiKey}&service=other`, | |
method: 'GET', | |
}); | |
// 97833 | |
if (response.response === 1) { | |
return response.tzid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const showDuration = startTime => { | |
let interval; | |
const formatTime = () => { | |
const distance = Date.now() - new Date(startTime); | |
let hours = Math.floor( | |
(distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) | |
); | |
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | |
let seconds = Math.floor((distance % (1000 * 60)) / 1000); | |
hours = hours < 10 ? "0" + hours : hours; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package app.package; | |
public class Keys { | |
public static final String USER_NAME = "username"; | |
public static class Post { | |
public static final String TITLE = "post_title"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var fbPhotosPhotoActionsItem | |
function getHttp(url, cb) { | |
let http = new XMLHttpRequest(); | |
http.open("GET", url, true); | |
http.onreadystatechange = function () { | |
if (http.readyState === 4) | |
cb(null, http.responseURL); | |
} |