Python Beem Project: Fugly Friends List Expanded Part 4

in #python5 years ago

I was playing with Bootstrap colors and one thing leads to another this happened...
1.png

https://floating-meadow-28045.herokuapp.com/

I was just working on Hive friends list and now it's got a steemit friend list 😅
Backend code is kind of copy and paste and repetitive so I have to do some refactor and clean up sometime before it gets too much lol

Backend steemit part is like this.

@app.route('/steemit/follower', methods=['GET', 'POST'])
def steemit_follower():
    form = UserNameForm(request.form)

    if request.method == 'POST':
        if form.validate():
            username = request.form['username'].lower()

            return redirect('/steemit/follower/' + username)
        else:
            flash('Username is Required')

    return render_template('steemit/follower.html', form=form)


@app.route('/steemit/follower/<username>')
@app.route('/steemit/follower/<username>/')
def steemit_follower_list(username=None):
    data = []
    if username:
        username = escape(username).lower()
        data = get_steemit_friends(username, 'followers')
    logging.warning(data)

    return render_template('steemit/follower_list.html',
                           username=username, data=data)


@app.route('/steemit/following', methods=['GET', 'POST'])
def steemit_following():
    form = UserNameForm(request.form)

    if request.method == 'POST':
        if form.validate():
            username = request.form['username'].lower()
            # logging.warning(username)

            return redirect('/steemit/following/' + username)
        else:
            flash('Username is Required')

    return render_template('steemit/following.html', form=form)


@app.route('/steemit/following/<username>')
@app.route('/steemit/following/<username>/')
def steemit_following_list(username=None):
    data = []
    if username:
        username = escape(username).lower()
        data = get_steemit_friends(username, 'following')
    logging.warning(data)

    return render_template('steemit/following_list.html',
                           username=username, data=data)

Here is a little demo.
5.gif

I can see followers and following lists on both Hive and Steemit.
I don't know how it's useful or not but it's responsive and works on mobile browser too.
5.png

I heard that new Bootstrap 5 is out as alpha and I watched some videos on YouTube yesterday.
It's got more colors and it's more customizable or something so I might try that just for fun even though I am not much of a frontend dev...
Bootstrap 5 - First Look


YouTube source

Next step is going to add Follow/Unfollow feature like this 👇 even though I am not going to unfollow everyone who is not following me back or anything like that.
It is kind of nice and surprising to see people on my friends list though... it is like 🤩
5.png

I just like this twitter feature and design so I wanted to make something similar to this.
This is going to be interesting 😆


Get Rewarded For Browsing! Are you Brave?


➡️ Website
➡️ Twitter

Sort:  

I don't really understand what this is but I just saw a friend's profile picture in the demo you made and it's exciting.

Hahaha I am glad you liked it!

I am not so much of a tech guy .. so i dont really understand a lot of things here.. would probably learn this language since it seems quite handy on this chain

python is a very popular programming language and "easy" to learn 😄

So i heard... i heard it might take me a week if i am serious to learn it.. do you have anything you recommend I look up to make learning easier?

Yes yes! I watched his youtube when I started learning python couple years ago.

He has like beginner stuff how to install and setup dev environment and how to program and all the good stuff.
Just watch and learn. https://www.youtube.com/c/Coreyms/playlists

Thank you for this.. I will look it up

I haven't started using Bootstrap 5 yet, I just use Bootstrap 4. How has your experience been with this framework version 5?
I would like to see your project working. 😃
Hug from Portugal 🇵🇹

Thank you! I am really a bootstrap newbie and I am pretty sure I am using it wrong 😂
But its fun to play with and I have watched a lot of tutorials online. leanred a lot!

If you are new to the bootstrap framework I recommend that you read the official documentation. Bootstrap is very agile and very fast to learn. I use it a lot!

Nice nice! I have been looking at their documentation page for few weeks!

I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!

Thank you ☺️

This is nice... I really wish I could code! I envy you Programmers

this is really not hard actually... i was really surprised too 😁

Is that a Flask API that you're using in Python?

Posted using Dapplr

Yes, it is a very simple flaks app 😂

I'm using the same thing for my project, the blockchain one 😂

Posted using Dapplr

Yes, I saw that 😉