create account

Discovering New Authors Faster by cristi

View this thread on: hive.blogpeakd.comecency.com
· @cristi ·
$8.09
Discovering New Authors Faster
<center>https://s4.postimg.org/stpazbwu5/Discovering_New_Authors_Faster.png</center>

In a discussion with @patrice the other day, she asked me if it's possible to parse the blockchain in way in which we could find authors who made their first post in certain timeframe.

A couple of back and forth messages, and I had something to work on; I was excited to experiment with the recently released ```steemtools``` python library by @furion. Many thanks! 

The purpose:

- discover new users faster - from their first blogpost
- eradicate spam/plagiarism in its infancy - from what I've seen, numerous new authors have been trying to fake it from their first post

This code can be further expanded/optimized for other purposes - come with ideas. 

So, here's the rationale behind the algorithm:

- parse all blocks from the last 24 hours (this could be modified)
- look for ```comment``` operations (blogposts and comments)
- restrict for blogposts
- if this is the author's first blogpost, retrieve the link
- output the link to the screen, and save it to file

The code is redundant on purpose: if it does not get executed to the end (god of code knows why?!), there's no file to look into for the links, so better be safe and output to the screen as you get the links.

However, the output to the screen will contain duplicates (some link may appear more than once). I can remediate the issues but the idea was to get this out immediately. 

This does not matter too much though, because once the code is completely executed, the duplicates are removed in the text file, so you get a clean final output. 

To run this, you obviously need Python and ```steemtools``` with all its dependencies. The guide to ```steemtools``` is provided by @furion in the release [post](https://steemit.com/steemtools/@furion/ann-steemtools-a-high-level-python-library-for-steem). 

Here's the code for my algorithm:

```python 
from steemtools.blockchain import Blockchain
from steemtools.base import Account, Post

b = Blockchain()

curr_block = b.get_current_block()
st_block = curr_block - 28800

# creating two lists, one will display results with duplicates
# the second list will be the clean one, without the duplicates
# removing duplicates could also be done with the set() function

postlist1 = []
postlist2 = []

# 'replaying' the blockchain for the timeframe established above
# filtering by comments (blogposts and comments)

for event in b.replay(start_block=st_block, end_block=curr_block, filter_by=['comment']):

    post = event['op']['permlink']
    author = event['op']['author']

# the meat of the code
# looking for blogposts from users with their first post in the last 24 hours

    if post[:3] != 're-' and len(Account(author).get_blog())==1:

        try:
            if Post.time_elapsed(Account(author).get_blog()[0])/3600 < 24:
                print(Post.get_url(Account(author).get_blog()[0]))
                postlist1.append(Post.get_url(Account(author).get_blog()[0]))

        except:
            continue

# removing duplicates

for item in postlist1:
    if item not in postlist2:
        postlist2.append(item)

# writing the final results to file

with open('newauthors.txt', 'wt') as f:
    for line in postlist2:
        f.write(line+'\n')

f.close()
```
You can get this code from my [github](https://github.com/CristiVlad25/stuff/blob/master/newauthors.py) as well. Use it at your discretion. 

If some of you guys want to get to curating right away, I ran the algorithm a couple of hours ago. Here's the output file:

```
https://steemit.com/health/@auky/the-basic-concept-of-post-partum-hemorrhage
https://steemit.com/spirituality/@nathanhoskins/gnosis-the-knowledge-of-insight
https://steemit.com/politics/@worldwidewojnar/how-america-has-changed-since-9-11
https://steemit.com/technology/@snails/digital-dementia-virus
https://steemit.com/vaccine/@sal1/vaccine-morass
https://steemit.com/news/@moveup/hello-self-driving-cars-goodbye-4-1-million-jobs
https://steemit.com/entrepreneurship/@tygers/why-delegating-responsibilities-is-crucial-for-your-business-or-tygers-magazine
https://steemit.com/photograpy/@jeffborba/photographing-at-home
https://steemit.com/money/@gravity9/in-the-news-bitcoin-technology-block-chain-energy-and-the-electricity-revolution
https://steemit.com/marcopolo/@marcopolo/creation-of-the-new-marco-polo-coming-soon
https://steemit.com/life/@mktom79/if-you-don-t-know-where-to-start-just-start
https://steemit.com/ethreum/@bruteforce/ethreum-minier
https://steemit.com/dance/@elfede/a-dancer-s-story
https://steemit.com/yocoin/@cryptoking619/pay-your-bills-with-yocoin
https://steemit.com/story/@kovalkovich/my-first-flight
https://steemit.com/education/@saynt01/give-education-not-policy
https://steemit.com/bienvenido/@tenet/comenzamos
https://steemit.com/trip/@fer7rules/my-experience-planning-a-trip-to-copenhagen-denmark
https://steemit.com/introducemyself/@msendyart/hello-steemit-visual-artist-endy-introduction
https://steemit.com/hobo/@hobogus/no-regrets
https://steemit.com/zero/@cmc613/baked-pasta-fake-out-1-0-servings-at-195-calories
https://steemit.com/introduceyourself/@fess/hi-steemit-i-m-fess-life-love-magic-and-traveling-journey-in-a-life-itself-this-is-my-blog-where-i-will-share-stories-from-my
https://steemit.com/writing/@pentingharterman/altitude-fair
https://steemit.com/airpods/@mrtobias/wireless-earbuds-why-do-people-fear-they-ll-fall-out-or-apple-s-airpods-are-on-the-right-track
https://steemit.com/introduceyourself/@barcisz/introduction-mindfunk-included
https://steemit.com/equality/@dragana/in-response-to-kate-upton-s-ig-post-and-those-who-have-an-issue-with-colin-kaepernick-s-protests
https://steemit.com/chile/@chile-dog/fear-distrust-and-anarchy-in-chile
https://steemit.com/voluntaryism/@gnosis474/let-justice-be-done-though-the-heavens-fall
https://steemit.com/spanish/@alfredozofio/lo-que-no-te-han-contado-de-la-edad-media
https://steemit.com/art/@digitalart/sharing-digital-art-on-steemit
https://steemit.com/ilovebuttsex/@copycat114/leafy-wants-to-die
https://steemit.com/cryptocurrency/@vaughnpierre/will-the-july-2016-bitcoin-block-halving-set-off-another-bitcoin-bubble
https://steemit.com/introduceyourself/@andreaalexandria/andrea-alexandria-detoxification-educator-now-on-steemit
https://steemit.com/introduction/@thejdah/intro
https://steemit.com/story/@liamobtv/introduction-and-ama-ask-me-anything-about-living-and-working-on-an-ayahuacsa-retreat-centre-in-the-amazon-jungle
https://steemit.com/rant/@raptorpc/my-first-rant-ever-hope-steemit-can-handle-me
https://steemit.com/cn/@harambeisgod/the-beauty-of-chinese
https://steemit.com/wildwill/@wildwill420/music
https://steemit.com/technology/@jeragon775/some-food-for-thought
https://steemit.com/story/@honeywish/the-rainbow-and-the-witch-part-1
https://steemit.com/bitcoin/@gaby64/end-the-blocksize-debate-with-gigabit-internet-access
https://steemit.com/new/@kbailey01/6xb4as
https://steemit.com/aquarium/@reefzone/hello-world
https://steemit.com/dating/@joeghaleb/a-letter-to-an-ex-girlfriend-that-was-never-shared-not-even-to-her-until-now-but-only-to-all-of-you
https://steemit.com/multifamily/@mrbrandondsmith/commercial-real-estate-market-updates
https://steemit.com/introduceyourself/@seansclevername/hello-creators-of-all-types
https://steemit.com/poetry/@itsallgoneleft/long-day
https://steemit.com/government/@sanfords/a-design-for-a-social-network-to-replace-government
https://steemit.com/funny/@lil.missy/this-hundred-year-old-tortoise-had-so-much-sex-he-actually-saved-his-species-from-extinction
https://steemit.com/photography/@ronvalentino/love
https://steemit.com/poetry/@insession/fruit
https://steemit.com/awesomenyl/@simple-mhe20/introduce-yourself
https://steemit.com/runescape/@dethykins/runescape-how-you-can-make-a-living-playing-a-game
https://steemit.com/entrepreneur/@nickcownie/why-it-absolutely-sucks-to-be-an-entrepreneur
```
I'm always looking forward to getting my hands dirty with code, so if you have suggestions for others statistics and analytics, please let me know!
___
### <center>To stay in touch with me, follow @cristi</center>

#programming #steemit #curie
___
[Cristi Vlad](http://cristivlad.com), Self-Experimenter and Author
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 42 others
properties (23)
authorcristi
permlinkdiscovering-new-authors-faster
categoryprogramming
json_metadata{"tags":["programming","steemit","curie"],"users":["patrice","furion","cristi"],"image":["https://s4.postimg.org/stpazbwu5/Discovering_New_Authors_Faster.png"],"links":["https://steemit.com/steemtools/@furion/ann-steemtools-a-high-level-python-library-for-steem","https://github.com/CristiVlad25/stuff/blob/master/newauthors.py","http://cristivlad.com"]}
created2016-09-17 12:48:54
last_update2016-09-17 12:48:54
depth0
children13
last_payout2016-10-18 15:11:48
cashout_time1969-12-31 23:59:59
total_payout_value6.152 HBD
curator_payout_value1.940 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,233
author_reputation128,305,218,872,904
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,275,849
net_rshares9,836,196,501,033
author_curate_reward""
vote details (106)
@clevecross ·
Holy shit. That is amazing work man.... well done
properties (22)
authorclevecross
permlinkre-cristi-discovering-new-authors-faster-20160917t130603548z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 13:06:03
last_update2016-09-17 13:06:03
depth1
children3
last_payout2016-10-18 15:11:48
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_length49
author_reputation7,635,074,529,912
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,276,001
net_rshares0
@cristi ·
thank you!
properties (22)
authorcristi
permlinkre-clevecross-re-cristi-discovering-new-authors-faster-20160917t131300307z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 13:13:00
last_update2016-09-17 13:13:00
depth2
children2
last_payout2016-10-18 15:11:48
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_length10
author_reputation128,305,218,872,904
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,276,043
net_rshares0
@clevecross ·
I love this comes out like this.... best way to address it.... just look at it flaunted!!! That was 24 hours?
properties (22)
authorclevecross
permlinkre-cristi-re-clevecross-re-cristi-discovering-new-authors-faster-20160917t131357831z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 13:13:57
last_update2016-09-17 13:13:57
depth3
children1
last_payout2016-10-18 15:11:48
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_length109
author_reputation7,635,074,529,912
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,276,054
net_rshares0
@clevecross ·
I think you may have been a little subtle with this line only
>eradicate spam/plagiarism in its infancy - from what I've seen, numerous new authors have been trying to fake it from their first post

Showed it to a friend and don't think they connected lol
properties (22)
authorclevecross
permlinkre-cristi-discovering-new-authors-faster-20160917t132018540z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 13:20:18
last_update2016-09-17 13:20:18
depth1
children0
last_payout2016-10-18 15:11:48
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_length255
author_reputation7,635,074,529,912
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,276,115
net_rshares0
@justtryme90 ·
Really great job with this @cristi, I think this could be very useful going forward.
properties (22)
authorjusttryme90
permlinkre-cristi-discovering-new-authors-faster-20160917t165445829z
categoryprogramming
json_metadata{"tags":["programming"],"users":["cristi"]}
created2016-09-17 16:54:42
last_update2016-09-17 16:54:42
depth1
children2
last_payout2016-10-18 15:11:48
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_length84
author_reputation140,118,479,939,905
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,277,838
net_rshares0
@cristi ·
it could be helpful in the curation process
properties (22)
authorcristi
permlinkre-justtryme90-re-cristi-discovering-new-authors-faster-20160917t170141990z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 17:01:42
last_update2016-09-17 17:01:42
depth2
children1
last_payout2016-10-18 15:11:48
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_length43
author_reputation128,305,218,872,904
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,277,904
net_rshares0
@justtryme90 ·
Completely agree
properties (22)
authorjusttryme90
permlinkre-cristi-re-justtryme90-re-cristi-discovering-new-authors-faster-20160917t170219841z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 17:02:18
last_update2016-09-17 17:02:18
depth3
children0
last_payout2016-10-18 15:11:48
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_length16
author_reputation140,118,479,939,905
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,277,911
net_rshares0
@lemouth ·
Indeed great to find new great authors and kill plagiarism and translations from the start (but probably a lot of work for following all of this).
properties (22)
authorlemouth
permlinkre-cristi-discovering-new-authors-faster-20160917t184634487z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 18:46:33
last_update2016-09-17 18:46:33
depth1
children1
last_payout2016-10-18 15:11:48
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_length146
author_reputation338,011,164,701,274
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,278,895
net_rshares0
@cristi ·
well, if you have the links readily available, it's a lot easier than checking the track record for each user :)
properties (22)
authorcristi
permlinkre-lemouth-re-cristi-discovering-new-authors-faster-20160917t200922569z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 20:09:24
last_update2016-09-17 20:09:24
depth2
children0
last_payout2016-10-18 15:11:48
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_length112
author_reputation128,305,218,872,904
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,279,642
net_rshares0
@linkback-bot-v0 ·
This post has been linked to from another place on Steem.


  - [The Rules of Rules](https://steemit.com/steemit/@clevecross/the-rules-of-rules) by @clevecross


Learn more about [**linkback bot v0.4**](https://steemit.com/steem/@ontofractal/steem-linkback-bot-v0-4-released). Upvote if you want the bot to continue posting linkbacks for your posts. Flag if otherwise.

Built by @ontofractal
👍  
properties (23)
authorlinkback-bot-v0
permlinkre-cristi-discovering-new-authors-faster-linkbacks
categoryprogramming
json_metadata{}
created2016-09-19 12:53:30
last_update2016-09-19 12:53:30
depth1
children0
last_payout2016-10-18 15:11:48
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_length392
author_reputation1,915,954,976,722
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,295,288
net_rshares15,573,464,746
author_curate_reward""
vote details (1)
@positivesteem ·
This is good. This is what is needed to boost new writers.
properties (22)
authorpositivesteem
permlinkre-cristi-discovering-new-authors-faster-2016917t21931894z
categoryprogramming
json_metadata{"tags":"programming"}
created2016-09-17 13:09:33
last_update2016-09-17 13:09:33
depth1
children1
last_payout2016-10-18 15:11:48
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_length58
author_reputation85,819,942,349,665
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,276,024
net_rshares0
@cristi ·
maybe find good new writers
properties (22)
authorcristi
permlinkre-positivesteem-re-cristi-discovering-new-authors-faster-2016917t21931894z-20160917t170112433z
categoryprogramming
json_metadata{"tags":["programming"]}
created2016-09-17 17:01:12
last_update2016-09-17 17:01:12
depth2
children0
last_payout2016-10-18 15:11:48
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_length27
author_reputation128,305,218,872,904
root_title"Discovering New Authors Faster"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,277,896
net_rshares0