create account

The Magic Story Machine: Automatically check and warn about submission length by tdre

View this thread on: hive.blogpeakd.comecency.com
· @tdre · (edited)
$36.60
The Magic Story Machine: Automatically check and warn about submission length
<div class="pull-right">
<img src="https://cdn.utopian.io/posts/b126aabf885b25580aefc32b21d192add0c5image.png" alt="the-magic-frog-src-cc-0-from-pixabay-remixed)" />
</div>

#### Project Background

[The Magic Story Machine](https://github.com/mktcode/the-magic-story-machine) is an open source bot for the Steem blockchain which enables collaborative storytelling. Prospective contributors suggest additions to the story by commenting on a daily post.

According to the mechanics of the storytelling game, which creator @mkt describes more fully [in this post](https://steemit.com/utopian-io/@mkt/the-magic-frog-collaborative-storytelling-bot-and-website), additions to the story are determined by community upvotes (i.e curation).  Contributions that are chosen for inclusion in the story are rewarded with a share from a 'pot' of cryptocurrency generated by the game's daily posts. 

Of course, all story suggestions โ€” whether daily winner or not โ€” can earn Steem for the poster.  

#### Components
This suggestion expands the validation and user feedback experience of the bot. This would involve modifying mainly:

`https://github.com/mktcode/the-magic-story-machine/blob/master/bot.js`

#### Proposal
By design users propose each addition to the running story by making a comment to the main daily post. This comment must begin with a blockquote (denoted in Markdown by the character `>` followed by a space):

```
> Write here what you want to append to the story, in one line.
Leave a space after the > and use no more than 250 characters.
```

As noted in the template above there is currently a limit of 250 characters for each submission.  If the user submits his suggestion via [a website specifically designed for the contest](http://the-magic-frog.com/) it will be checked to enforce this limit.  

In contrast submissions made by another Steem blockchain platform โ€” Steemit, for example โ€” are not validated this way. It is easy for a new or very enthusiastic contributor to run over the limit. Indeed this author did so on his own first submission.

After determining if a comment begins with a blockquote it can be further validated as to whether it is shorter than 250 characters.  If the submission is too long the bot can post feedback stating so, as well as recommending use of the game website to avoid the mistake in the future. 

#### Mockups / Examples
Here is a sample implementation  to illustrate the validation in pseudocode, assuming an events framework similar to [SteemBot](https://github.com/tdreid/steem-bot) and a utility library like [Lodash](https://lodash.com/docs/4.17.10#startsWith):
```javascript
bot.onComment((comment, responder) => {
  if (_.startsWith(comment.body, '> ') && comment.body.length > 250) {
    responder.comment(
      'You exceeded the character limit of 250.' +
        'Please use http://the-magic-frog.com/' +
        'to avoid this common mistake.'
    );
  }
});
``` 
Here is how the process might appear to the user:

![image.png](https://cdn.utopian.io/posts/964ae5befad800c5786b09f8f8030bab1d6bimage.png)

***
> Image [src](https://pixabay.com/en/amphibian-animal-1298147/) CC-0 from Pixabay (remixed)

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tdre/the-magic-story-machine-automatically-check-and-warn-about-submission-length">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
๐Ÿ‘  , , , , , , , , , , , , , , , ,
properties (23)
authortdre
permlinkthe-magic-story-machine-automatically-check-and-warn-about-submission-length
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":129508834,"name":"the-magic-frog","full_name":"mktcode/the-magic-frog","html_url":"https://github.com/mktcode/the-magic-frog","fork":false,"owner":{"login":"mktcode"}},"pullRequests":[],"platform":"github","type":"ideas","tags":["utopian-io","story","funny","crypto","new"],"users":["mkt","tdre"],"links":["https://github.com/mktcode/the-magic-story-machine","https://steemit.com/utopian-io/@mkt/the-magic-frog-collaborative-storytelling-bot-and-website","http://the-magic-frog.com/","https://github.com/tdreid/steem-bot","https://lodash.com/docs/4.17.10#startsWith","https://cdn.utopian.io/posts/964ae5befad800c5786b09f8f8030bab1d6bimage.png","https://pixabay.com/en/amphibian-animal-1298147/"],"image":["https://cdn.utopian.io/posts/964ae5befad800c5786b09f8f8030bab1d6bimage.png"],"moderator":{"account":"syedumair","time":"2018-04-28T07:21:52.762Z","pending":false,"reviewed":true,"flagged":false},"questions":null,"score":null,"total_influence":null,"staff_pick":null,"staff_pick_by":null,"config":{"questions":[{"question":"Is the suggested feature commonly seen in other similar projects?","question_id":"ideas-1","answers":[{"answer":"No, itโ€™s unique or very rare.","answer_id":"ideas-1-a-1","value":10},{"answer":"Yes, but itโ€™s a feature of high importance for this kind of project.","answer_id":"ideas-1-a-2","value":9},{"answer":"It's common, but it will have some measurable positive impact on the user experience.","answer_id":"ideas-1-a-3","value":3},{"answer":"Itโ€™s extremely common and not majorly impactful.","answer_id":"ideas-1-a-4","value":0}]},{"question":"Does this suggestion match the goals and/or roadmap of the project?","question_id":"ideas-2","answers":[{"answer":"Yes, itโ€™s closely related to the main goals of the project.","answer_id":"ideas-2-a-1","value":15},{"answer":"It is related, but does not match the main goal and purpose of the project.","answer_id":"ideas-2-a-2","value":10.5},{"answer":"It is loosely related to one of the goals of the project.","answer_id":"ideas-2-a-3","value":6},{"answer":"It is not related to the project goals at all.","answer_id":"ideas-2-a-4","value":0}]},{"question":"Is the proposal realistic?","question_id":"ideas-3","answers":[{"answer":"Yes, it can definitely be achieved and is important enough to warrant the developers attention and time.","answer_id":"ideas-3-a-1","value":10},{"answer":"Yes, it can definitely be achieved, but is not likely to get noticed by the development team immediately.","answer_id":"ideas-3-a-2","value":8},{"answer":"It can be achieved theoretically, but no open source solutions to this problem have been suggested previously.","answer_id":"ideas-3-a-3","value":4},{"answer":"No, itโ€™s impossible to achieve.","answer_id":"ideas-3-a-4","value":0}]},{"question":"What is the potential impact of the change proposed on the usability of the project?","question_id":"ideas-4","answers":[{"answer":"It will have a major positive impact on the project for both the project owner and end user.","answer_id":"ideas-4-a-1","value":15},{"answer":"It will have a significant impact on the project for end users.","answer_id":"ideas-4-a-2","value":12},{"answer":"It will change how users utilize the project by a minor margin.","answer_id":"ideas-4-a-3","value":6},{"answer":"It will bring little to no change","answer_id":"ideas-4-a-4","value":0}]},{"question":"Has the contributor proposed a possible solution to implement the suggestion?","question_id":"ideas-5","answers":[{"answer":"Yes, the possible solution is described in great detail and makes a lot of sense.","answer_id":"ideas-5-a-1","value":5},{"answer":"Yes, but the possible solution was not described in sufficient detail.","answer_id":"ideas-5-a-2","value":4},{"answer":"No, but the implementation is self explanatory.","answer_id":"ideas-5-a-3","value":4},{"answer":"No, thereโ€™s no proposed solution though one is clearly necessary.","answer_id":"ideas-5-a-4","value":0}]},{"question":"Is the suggestion original in nature, or were similar suggestions submitted to Utopian in the past?","question_id":"ideas-6","answers":[{"answer":"The suggestion is original and obviously unique.","answer_id":"ideas-6-a-1","value":10},{"answer":"This kind of suggestion is fairly uncommon on Utopian.","answer_id":"ideas-6-a-2","value":8},{"answer":"This is a common suggestion for other projects.","answer_id":"ideas-6-a-3","value":2},{"answer":"The suggestion is clearly not well thought-out and holds no actual value.","answer_id":"ideas-6-a-4","value":0}]},{"question":"Has the user provided any mockups (illustrations) of potential suggestion implementation appearance?","question_id":"ideas-7","answers":[{"answer":"Yes, and theyโ€™re of excellent quality.","answer_id":"ideas-7-a-1","value":5},{"answer":"No, but the mockups are inapplicable for this suggestion.","answer_id":"ideas-7-a-2","value":5},{"answer":"Yes, but the quality of the mockups is poor.","answer_id":"ideas-7-a-3","value":2},{"answer":"No, there are no mockups included even though they are needed.","answer_id":"ideas-7-a-4","value":0}]},{"question":"How would you describe the formatting, language and overall presentation of the post?","question_id":"c-1","answers":[{"answer":"The post is of very high quality.","answer_id":"c-1-a-1","value":10},{"answer":"The post is of decent quality, but not spectacular in any way.","answer_id":"c-1-a-2","value":7},{"answer":"The post is poorly written and/or formatted, but readable.","answer_id":"c-1-a-3","value":3},{"answer":"The post is really hard to read and the content is barely understandable.","answer_id":"c-1-a-4","value":0}]},{"question":"How would you rate the overall value of this contribution on the open source community and ecosystem?","question_id":"c-2","answers":[{"answer":"This contribution brings great and impactful value, and can be used for applications outside the specific project.","answer_id":"c-2-a-1","value":20},{"answer":"This contribution adds significant value to the open source community and ecosystem, or is of critical importance to the specific project.","answer_id":"c-2-a-2","value":16},{"answer":"This contribution adds some value to the open source community and ecosystem or is only valuable to the specific project.","answer_id":"c-2-a-3","value":8},{"answer":"This contribution adds no value to the open source community and ecosystem or the specific project.","answer_id":"c-2-a-4","value":0}]}]}}"
created2018-04-28 01:06:18
last_update2018-04-28 07:21:51
depth0
children9
last_payout2018-05-05 01:06:18
cashout_time1969-12-31 23:59:59
total_payout_value26.570 HBD
curator_payout_value10.029 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,380
author_reputation28,296,055,808,693
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,549,292
net_rshares6,557,058,883,085
author_curate_reward""
vote details (17)
@ebargains ·
$1.52
re-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t135845308z
You got a 19.24% Upvote and Resteem from @ebargains, as well as upvotes from our curation trail followers!

If you are looking to earn a passive no hassle return on your Steem Power, delegate your SP to @ebargains by clicking on one of the ready to delegate links:
[50SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=50%20SP) | [100SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=100%20SP) | [250SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=250%20SP) | [500SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=500%20SP) | [1000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=1000%20SP) | [5000SP](https://steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=ebargains&vesting_shares=5000%20SP) | [Custom Amount](https://steembottracker.com/delegation.html?delegatee=ebargains)
 
You will earn 80% of the voting service's earnings based on your delegated SP's prorated share of the service's SP pool daily! That is up to 38.5% APR! You can also undelegate at anytime.

We are also a very profitable curation trail leader on https://steemauto.com/. Follow @ebargains today and earn more on curation rewards!
๐Ÿ‘  , , , ,
properties (23)
authorebargains
permlinkre-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t135845308z
categoryutopian-io
json_metadata{"app":"auto-voter/1.0.0"}
created2018-04-28 13:58:45
last_update2018-04-28 13:58:45
depth1
children0
last_payout2018-05-05 13:58:45
cashout_time1969-12-31 23:59:59
total_payout_value1.518 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,385
author_reputation46,529,372,336,823
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,648,103
net_rshares238,649,262,193
author_curate_reward""
vote details (5)
@lanzjoseg ·
$0.03
Wow, this would be great to do in Spanish. It hurts that my English is limited to the translator, but being able to do it in Spanish will be super great.
๐Ÿ‘  
properties (23)
authorlanzjoseg
permlinkre-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t191958687z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-04-28 18:46:54
last_update2018-04-28 18:46:54
depth1
children0
last_payout2018-05-05 18:46:54
cashout_time1969-12-31 23:59:59
total_payout_value0.022 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length153
author_reputation864,910,178,548,486
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,692,887
net_rshares4,635,195,187
author_curate_reward""
vote details (1)
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by tdre from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows.  Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
properties (22)
authorminnowsupport
permlinkre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t035250z
categoryutopian-io
json_metadata"{"app": "beem/0.19.23"}"
created2018-04-28 03:52:51
last_update2018-04-28 03:52:51
depth1
children0
last_payout2018-05-05 03:52:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,700
author_reputation148,902,805,319,183
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,569,145
net_rshares0
@mkt ·
$0.28
Thanks for the suggestion! This (and more) is absolutely planned!
I'm just a lazy programmer... so it will take some time! ;)
๐Ÿ‘  
properties (23)
authormkt
permlinkre-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t142258230z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-04-28 14:23:00
last_update2018-04-28 14:23:00
depth1
children2
last_payout2018-05-05 14:23:00
cashout_time1969-12-31 23:59:59
total_payout_value0.212 HBD
curator_payout_value0.071 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length125
author_reputation45,513,283,519,678
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,652,175
net_rshares44,961,393,319
author_curate_reward""
vote details (1)
@tdre ·
Once upon a time there was a lazy programmer... ;D
properties (22)
authortdre
permlinkre-mkt-re-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t174602233z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-04-28 17:46:03
last_update2018-04-28 17:46:03
depth2
children1
last_payout2018-05-05 17:46:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length50
author_reputation28,296,055,808,693
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,684,472
net_rshares0
@mkt ·
That's a whole different story.... but yeah... it starts with that sentence! xD
properties (22)
authormkt
permlinkre-tdre-re-mkt-re-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t224231890z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-04-28 22:42:33
last_update2018-04-28 22:42:33
depth3
children0
last_payout2018-05-05 22:42:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length79
author_reputation45,513,283,519,678
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,720,539
net_rshares0
@syedumair ·
$0.18
Thank you. Your contribution has been approved. 

----------------------------------------------------------------------
Need help? Write a ticket on https://support.utopian.io.
Chat with us on [Discord](https://discord.gg/uTyJkNm).

**[[utopian-moderator]](https://utopian.io/moderators)**
๐Ÿ‘  
properties (23)
authorsyedumair
permlinkre-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t072835679z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-28 07:28:39
last_update2018-04-28 07:28:39
depth1
children1
last_payout2018-05-05 07:28:39
cashout_time1969-12-31 23:59:59
total_payout_value0.180 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length290
author_reputation217,827,463,642,367
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries
0.
accountutopian.pay
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,595,685
net_rshares43,570,834,763
author_curate_reward""
vote details (1)
@tdre ·
Cool, I appreciate you taking the time to moderate and comment @syedumair
properties (22)
authortdre
permlinkre-syedumair-re-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180428t105507989z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["syedumair"],"app":"steemit/0.1"}
created2018-04-28 10:55:09
last_update2018-04-28 10:55:09
depth2
children0
last_payout2018-05-05 10:55:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length73
author_reputation28,296,055,808,693
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,622,152
net_rshares0
@utopian-io ·
$0.28
### Hey @tdre! Thank you for the great work you've done!
We're already looking forward to your next contribution!
#### Fully Decentralized Rewards
We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.
#### Utopian Witness!
<a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for Utopian Witness!</a> We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

**Want to chat? Join us on Discord https://discord.me/utopian-io**
๐Ÿ‘  
properties (23)
authorutopian-io
permlinkre-tdre-the-magic-story-machine-automatically-check-and-warn-about-submission-length-20180430t020146194z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-04-30 02:01:48
last_update2018-04-30 02:01:48
depth1
children0
last_payout2018-05-07 02:01:48
cashout_time1969-12-31 23:59:59
total_payout_value0.208 HBD
curator_payout_value0.069 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length684
author_reputation152,955,367,999,756
root_title"The Magic Story Machine: Automatically check and warn about submission length"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,937,288
net_rshares45,017,300,281
author_curate_reward""
vote details (1)