Skip to content

Commit

Permalink
2nd webgl contest results
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCox9 committed Feb 18, 2018
1 parent ed348a2 commit d47b845
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 25 deletions.
162 changes: 154 additions & 8 deletions config.js
Expand Up @@ -9,7 +9,7 @@ config.steem.url = 'wss://steemd-int.steemit.com';
config.steem.auth_type = 'owner'; //owner, posting

//delay in milliseconds between each write transaction
config.steem.delay = 200;
config.steem.delay = 10000;

//must be from username, goes with demo start.js
config.steem.sample_post = 'creating-first-steemit-bot';
Expand All @@ -20,10 +20,107 @@ config.steem.sample_post = 'creating-first-steemit-bot';
config.steem.start = "";

//memos only
config.steem.type = 'followers'; //either following or followers
config.steem.message = 'Hi @username Your earnings: 0.001 SBD https://steemit.com/follow/@money-dreamer/follower-earnings Un/follow to un/subscribe.'; //message to be sent in each memo (@username will be replaced)
config.steem.type = false; //either following or followers
config.steem.message = 'Hi @username! You won 0.200 SBD in the WebGL Screen Capture Contest. See all the winners and enter next weeks contest: https://steemit.com/contest/@money-dreamer/25-sbd-webgl-screen-capture-contest'; //message to be sent in each memo (@username will be replaced)
config.steem.amount = '0.001 SBD'; //amount of SBD or STEEM to send to each follower/following
config.steem.send_memos_to = null;
config.steem.send_memos_to = ['widia',
'virtalch',
'travoved',
'topgeek',
'teggy',
'tech-mac',
'sweetscentof98',
'sunnia',
'summer14',
'styleit',
'styleit',
'sheloumith',
'sheloumith',
'scarletsnow',
'scarletsnow',
'sara-writes',
'pegyurme',
'pegyurme',
'peak.endrule',
'mrzurkon',
'mrzurkon',
'mahathiruddin',
'lundgreenman',
'laxmikadariya',
'kunani',
'kunani',
'kunani',
'kephawalks',
'kephawalks',
'kamesh',
'kamesh',
'kailukat',
'josephlacsamana',
'josephlacsamana',
'josephlacsamana',
'johnstone',
'johnstone',
'johnstone',
'johnstone',
'johnstone',
'johnarvee12',
'johnarvee12',
'jerome-morales',
'jerome-morales',
'jerome-morales',
'jerome-morales',
'jaguarcars',
'jaguarcars',
'jaguarcars',
'jaguarcars',
'izaid',
'izaid',
'izaid',
'ironshield',
'ilovekrys',
'hsqtech',
'hsqtech',
'hsqtech',
'himash21',
'himash21',
'himash21',
'himash21',
'geeyang15',
'geeyang15',
'geeyang15',
'fooddadiph',
'fooddadiph',
'fooddadiph',
'evansbankx',
'dotapamore',
'dotapamore',
'csalupado',
'cryptohawk1',
'cjsean',
'carloniere',
'carloniere',
'carloniere',
'bitpizza',
'bitpizza',
'bitpizza',
'bitpizza',
'bitfiend',
'belemo',
'armoniritmia',
'armoniritmia',
'armoniritmia',
'armoniritmia',
'amico',
'ailenepm',
'ailenepm',
'ailenepm',
'afzaal4',
'afzaal4',
'achmadkurniawan',
'aamirijaz',
'aamirijaz',
'aamirijaz',
'aamirijaz'];

//curation only
config.steem.curation_type = 'created'; //created, hot or trending
Expand All @@ -39,6 +136,7 @@ config.steem.require_followers = true;//contestents must be following to qualify
config.steem.require_resteem = true;//a comment entry must contain an image to qualify
config.steem.created_by = '';//set deadline for entries
config.steem.filter_by_date = '2018-02-15 20:27:27';//set deadline for latest update to entries, else false
config.steem.filter_by_accounts = ['money-dreamer'];//array of disqualified accounts, else false
config.steem.filter_by_disqualified = [ 're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t114642362z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t193538521z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t200502158z',
Expand All @@ -64,11 +162,59 @@ config.steem.filter_by_disqualified = [ 're-money-dreamer-40-sbd-webgl-screen-ca
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t025158029z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t025650963z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180212t062228890z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t065145604z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t220547338z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t215439805z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t203800581z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t025247573z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t121223289z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180212t082036933z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t175637412z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t144153441z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t143556804z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t161034457z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180208t212715808z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t094950619z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t201824019z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t112617598z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t110618348z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t094106519z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t130939228z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t073058832z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t015853437z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180214t192259398z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t111921814z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t095236005z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t181655732z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t223744317z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180212t081903583z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t100838375z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180212t015407779z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180208t212833164z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t144517787z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t114809691z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t100321254z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180208t213444372z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t120638164z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t050742661z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t104649533z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t033245349z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t200557955z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t144704671z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t070238044z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180208t230227225z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t025420173z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t133013417z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t195001944z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t090745719z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t143710236z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180214t192006278z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180209t175752810z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t024359189z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180214t192632148z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180214t185431752z'];//a list of entry permlinks that are manually disqualified, else false



're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180211t180932359z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180210t033224913z',
're-money-dreamer-40-sbd-webgl-screen-capture-contest-20180214t185431752z'];//an array of entry permlinks that are manually disqualified, else false


//follow_back only
Expand Down
57 changes: 42 additions & 15 deletions generate_contest_winners.js
Expand Up @@ -15,7 +15,7 @@ function filterByAuthor() {
filtered_accounts.push( authorArray[i].name );
}
}
console.log( 'filtered by authors: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by authors: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -26,7 +26,7 @@ function filterByFollowers() {
filtered_entries.push( entryArray[i] );
}
}
console.log( 'filtered by followers: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by followers: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -37,7 +37,7 @@ function filterByGraphic() {
filtered_entries.push( entryArray[i] );
}
}
console.log( 'filtered by graphic: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by graphic: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -48,7 +48,7 @@ function filterByLink() {
filtered_entries.push( entryArray[i] );
}
}
console.log( 'filtered by link: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by link: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -63,7 +63,7 @@ function filterByResteem() {
}
}
}
console.log( 'filtered by resteem: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by resteem: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -81,7 +81,7 @@ function filterByDisqualified() {
if( ! disqualified )
filtered_entries.push( entryArray[j] )
}
console.log( 'filtered by disqualified: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by disqualified: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

Expand All @@ -99,10 +99,29 @@ function filterByDate() {
filtered_entries.push( entryArray[j] );
}
}
console.log( 'filtered by date: '+filtered_entries.length+'<br>' );
console.log( 'Filtered by date: '+filtered_entries.length+'<br>' );
return filtered_entries;
}

function filterByAccounts() {
var filtered_entries = [];
for (var j = entryArray.length - 1; j >= 0; j--) {
let disqualified = false;
for (var i = config.steem.filter_by_accounts.length - 1; i >= 0; i--) {
//console.log( 'result #'+i+': '+reblogged_by[i] );
//console.log( 'entry #'+j+': '+entryArray[j].author );
if( config.steem.filter_by_accounts[i] == entryArray[j].author ) {
disqualified = true;
}
}
if( ! disqualified )
filtered_entries.push( entryArray[j] )
}
console.log( 'Filtered by accounts: '+filtered_entries.length+'<br>' );
return filtered_entries;
}


function applyFilters() {
if( config.steem.require_follow )
entryArray = filterByFollowers();
Expand All @@ -118,6 +137,8 @@ function applyFilters() {
entryArray = filterByDisqualified();
if( config.steem.filter_by_date )
entryArray = filterByDate();
if( config.steem.filter_by_accounts )
entryArray = filterByAccounts();
applyOrdering();
}

Expand Down Expand Up @@ -146,7 +167,8 @@ function applyOrdering() {
//Order replies by total number of replies/subreplies
//Order replies by account attributes such as reputation, followers/ing, activity, sp, balances, etc...
//Order replies by manual verification
printWinners();
//printWinners();
dumpWinnerArray( );
}

function extractUrl(body,link) {
Expand All @@ -170,12 +192,17 @@ function printWinners( ) {
for (var i = entryArray.length - 1; i >= 0; i--) {
let link = extractUrl( entryArray[i].body, config.steem.contest_sublink );
let image = extractUrl( entryArray[i].body, 'https://steemitimages.com/' );
console.log( '<hr/><img style="max-width:100;max-height:100;" src="'+image+'">' );
console.log( '<a href="'+link+'">overview</a> | <a href="https://steemit.com'+entryArray[i].url+'">entry</a> | <a href="https://steemit.com/@'+entryArray[i].author+'">'+entryArray[i].author+'</a><br><br><br>' )
console.log( '<hr/><img style="max-width:800;max-height:600;" src="'+image+'"><br>' );
console.log( '<h3><a href="'+link+'">overview</a> | <a href="https://steemit.com'+entryArray[i].url+'">entry</a> | <a href="https://steemit.com/@'+entryArray[i].author+'">'+entryArray[i].author+'</a></h3><br><br><br>' )
console.log("<br>");
}
}

function dumpWinnerAuthors( ) {
for (var i = entryArray.length - 1; i >= 0; i--)
console.log( '@'+entryArray[i].author+' ' );
}

function dumpWinnerArray( ) {
var winners = [];
for (var i = entryArray.length - 1; i >= 0; i--)
Expand All @@ -184,7 +211,7 @@ function dumpWinnerArray( ) {
}

function getAuthors(reblogged_by=[]) {
console.log( 'Total Resteems: ' + reblogged_by.length );
console.log( 'Total Resteems: ' + reblogged_by.length+'<br>' );
rebloggedByArray = reblogged_by;
authors=[];
for (var i = entryArray.length - 1; i >= 0; i--) {
Expand All @@ -195,7 +222,7 @@ function getAuthors(reblogged_by=[]) {

//Get all 1st level replies
function getRebloggedBy(error, entries=[]) {
console.log( 'Total Entries: '+entries.length );
console.log( 'Total Entries: '+entries.length+'<br>' );
entryArray = entries;
//console.log( JSON.stringify(entries) );
//console.log( entries );
Expand All @@ -204,12 +231,12 @@ function getRebloggedBy(error, entries=[]) {

//Callback function for getFollowers
function getContestReplies(followers=[]) {
console.log( 'Total Followers: '+followers.length );
console.log( 'Total Followers: '+followers.length+'<br>' );
followersArray = followers;
steem.api.getContentReplies(config.steem.username, config.steem.contest_permlink, getRebloggedBy);
}

//Get followers
//library.getFollowers(config.steem.username,'',1000, getContestReplies);
library.getFollowers(config.steem.username,'',1000, getContestReplies);

getContestReplies([]);
//getContestReplies([]);
1 change: 1 addition & 0 deletions library_auth.js
Expand Up @@ -13,6 +13,7 @@ module.exports = {
try {
let message = config.steem.message;
message = message.replace( '@username', '@'+accounts[i] );
console.log( message );
steem.broadcast.transfer(wif, config.steem.username, accounts[i], config.steem.amount, message, function(err, result) {
console.log(err, result);
});
Expand Down
3 changes: 1 addition & 2 deletions send_memo.js
Expand Up @@ -11,8 +11,7 @@ function filterAccounts( accounts = [] ) {
let filtered_accounts = [];
for (var i = response.length - 1; i >= 0; i--) {
if( parseInt(response[i].reputation) > parseInt(1000000) ) {
filtered_accounts.push( response[i].name );
}
filtered_accounts.push( response[i].name );
}
}

Expand Down

0 comments on commit d47b845

Please sign in to comment.