This file contains 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
/** | |
* Cleaner - remove useless elements | |
* based on Additional Enhancements by XjSv | |
* | |
* @author Epexa | |
* @version 1.0.0 | |
* @url https://gist.githubusercontent.com/Epexa/e4c7c7870d2b3d4f4314404497c16bdf/raw | |
* @last-edit 06.29.2016 15:40 | |
*/ |
This file contains 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
// output post | |
res.json({ | |
created: result.created, | |
title: result.title, | |
body: imgUrlReplace(result.body) | |
}); | |
// replace all img links to own domain | |
function imgUrlReplace(url) { | |
/*return url.replace(/https:\/\/images.golos.io\/([a-zA-Z0-9]+)\/([0-9+]).jpg/g, function(match) { |
This file contains 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
<script src="https://cdn.jsdelivr.net/npm/golos-js/dist/golos.min.js"></script> | |
<script> | |
// поиск аккаунта по юзернейму | |
var usernames = ['epexa', 'epexa2']; | |
golos.api.lookupAccountNames(usernames, function(err, result) { | |
//console.log(err, result); | |
if ( ! err) { | |
result.forEach(function(item) { | |
if (item) console.log('lookupAccountNames', 'username: [', item.name, '] id: [', item.id, ']'); | |
else console.log('lookupAccountNames', 'аккаунт не найден!'); |
This file contains 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
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/steem.min.js"></script> | |
<script> | |
steem.api.setOptions({ url: 'https://api.steemit.com' }); | |
// поиск аккаунта по юзернейму | |
var usernames = ['epexa', 'epexa2']; | |
steem.api.lookupAccountNames(usernames, function(err, result) { | |
//console.log(err, result); | |
if ( ! err) { | |
result.forEach(function(item) { |
This file contains 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
<!-- | |
0.5.21 - для текущей версии чейна | |
0.5.29 - для тестнета | |
--> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/golos.min.js"></script> | |
<script> | |
/** | |
* getFollowers() возвращает подписчиков (кто подписан) | |
* @param {String} following - юзернейм на которого подписаны | |
* @param {String} startFollower - позиция с какого элемента возвращать результат |
This file contains 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
<!-- | |
0.5.29 - для тестнета | |
0.5.30 - для текущей версии чейна | |
--> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/golos.min.js"></script> | |
<script> | |
// переключение на тестнет | |
/*golos.api.setOptions({ | |
'websocket': 'wss://ws.testnet.golos.io', | |
'address_prefix': 'GLS', |
This file contains 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 usernamesArr = ['epexa']; | |
golos.api.getAccounts(usernamesArr, function(err, response) { | |
if ( ! err) { | |
var privWif = '5J...'; // private key | |
var resultWifToPublic = golos.auth.wifToPublic(privWif); | |
// example check of private posting key | |
if (response[0].posting.key_auths[0][0] == resultWifToPublic) console.log('yes, is it private posting key!'); | |
else console.log('no, is it not private posting key!'); | |
} | |
}); |
This file contains 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 username = 'epexa'; | |
var password = 'P5H...'; // мастер-пароль | |
golos.api.getAccounts([username], function(err, response) { | |
if ( ! err) { | |
// получение публичного ключа | |
var roles = ['posting']; // параметр необязательный, если не указаывать, то вернутся все ключи | |
var keys = golos.auth.getPrivateKeys(username, password, roles); | |
// проверка публичного ключа аккаунта и с полученым публичным ключом | |
if (response[0].posting.key_auths[0][0] == keys.postingPubkey) console.log('правильный логин и мастер-пароль!'); | |
else console.log('не правильный логин и\или мастер-пароль!'); |
This file contains 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 golos = require('golos-js'); | |
// switch to testnet | |
golos.config.set('websocket', 'wss://ws.testnet3.golos.io'); | |
golos.config.set('chain_id', '5876894a41e6361bde2e73278f07340f2eb8b41c2facd29099de9deef6cdb679'); | |
let trx = { | |
ref_block_num: 49191, | |
ref_block_prefix: 2024493436 | |
}; |
This file contains 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 golos = require('golos-js'); | |
const moment = require('moment'); | |
// switch to testnet | |
golos.config.set('websocket', 'wss://ws.testnet3.golos.io'); | |
golos.config.set('chain_id', '5876894a41e6361bde2e73278f07340f2eb8b41c2facd29099de9deef6cdb679'); | |
// private posting key | |
let wif = '5J...'; |
OlderNewer