Python Beem Project: Fugly Friends List Temporary Home Part 2

in #hive-103590last month

My fugly follower/following list found a temporary home here.

I haven't added follow/unfollow thing yet, but I just deployed to hero for now.

I think list looks ok but overall... still kind of look weird to me.
But I will work on the design later.

Anybody know a super simple way to deploy web app somewhere for free? 😂
I kind of want to pipeline and automate the whole development and deploy thing... but I don't know exactly how that works so I just don't want to spend money for something before I play around with it.

This is my beem project repo here.
Main app code is only this much

from beem import Hive
from beem.nodelist import NodeList
from beem.account import Account

from flask import Flask, render_template, redirect
from forms import UserNameForm
from markupsafe import escape
from config import Config
import logging

app = Flask(__name__)

# logging.warning("APP STARTED")

def not_found(e):
    form = UserNameForm()
    return render_template('index.html', form=form)

@app.route('/', methods=('GET', 'POST'))
def index():
    form = UserNameForm()
    if form.validate_on_submit():
        username =

        # return redirect(url_for('friends'))
        return redirect('/friends/' + username)

    return render_template('index.html', form=form)

def friends(username=None):
    data = {}
    if username:
        username = escape(username).lower()
        data['followers'] = get_friends_data(username, 'followers')
        data['following'] = get_friends_data(username, 'following')

    return render_template('friends.html', data=data)

def get_friends_data(username, follow_type):
    # Setup node list
    nodelist = NodeList()
    nodes = nodelist.get_hive_nodes()
    hive = Hive(node=nodes)
    # logging.warning(hive.config.items())

    # Create account object
        account = Account(username)
    except Exception as e:
        return {}

    followers = account.get_followers()
    following = account.get_following()

    if follow_type == 'followers':
        return make_dict(followers, following)
        return make_dict(following, followers)

def make_dict(data_list, find_list):
    my_dict = {}

    for data in data_list:
        if data in find_list:
            my_dict[data] = 1
            my_dict[data] = 0
    return my_dict

Still a working progress... everything is super messy and I need to clean up
My goal is to be able to organize the friends list so I still have a lot more to go but it's been fun playing with beem and deploy tools and stuff.

Get Rewarded For Browsing! Are you Brave?

Posted with Esteem


Your post has been boosted with ESTM. Keep up the good work!
Dear reader, Install Android:, iOS: mobile app or desktop app for Windows, Mac, Linux:
Learn more:
Join our discord: