Share your repls and programming experiences

← Back to all posts
Repl-Customs!!! (v1)
IreTheKID (275)

Repl-Customs Is Finally Here! 🎉


Hey all, If you saw my first post Announcing "Repl Customs" you'd know that this was supposed to release last Friday but I'm incompetent I ran into quite a lot of issues with Flask, the repltalk package, and just general Python 3 frustrations. Also online school is also a lot harder than I thought it would be! So, Without further ado, Here is Repl Customs!!!

What is Repl-Customs? 🤔

Repl Customs is a data solution I created to allow users to search the Repl database for custom data solutions. That doesn't answer anything but OK You can find out answers to questions like, "How many upvotes does my post get in an hour?" or "Who commented the most in the past week?" Things like this are easy to look at with Repl Customs!

The Current State of Things. 📈

Repl Customs is still in early development and the only real feature is looking up Repl users and getting a glorified profile page, but that is just the beginning! I want this to be a fully-fledged web app that is worth your time to visit. So look forward to constant updates and changes! I’ll be working on this for next few months.

Want to Contribute? 📝

If this project piques your interest and you would like to contribute to this project as Repl user @adityaru first offered, I will be opening a GitHub repo for it soon, and I’ll update this post when I do that. Anyone who wants to can read the guide and then open a pull request with your desired changes/updates! (Right now there’s an issue with printing a comment’s post title to the web app, so if you have a fix for that please feel free to help out!😀)

EDIT: The project is now open and public!!! Go check it out here!

With all that said, please enjoy the first official release of Repl-Customs! 😎😎 🎉🎉

IreTheKID

Commentshotnewtop
IreTheKID (275)

Thank you guys for all the support!!! :) Over the last 48 hours, there were 279 unique website visits, and over 11 minutes were spent on the site on average! \(OwO)/

HahaYes (893)

@IreTheKID Did you earn money from this site?

IreTheKID (275)

@HahaYes What!?! no, there aren't any ads or anything, and I'm not even old enough to make revenue unless my parents open a fund or something.

HahaYes (893)

@IreTheKID Lol someone made a million dollars where companies bought pixel by pixel of a screenpage. I should do that real quick

HahaYes (893)

@IreTheKID can you even put ads on REPL?

IreTheKID (275)

@HahaYes well, ad containers can be put into an HTML file, and generated on loading the page, so yeah. The money would go to the account you've registered with your ad service, so yeah, in theory, you could make money from a repl. I've never seen it done before though.

HahaYes (893)

@IreTheKID Huh, time to use my information that I learned about pyramid schemes into this

IreTheKID (275)

@HahaYes ppl still fall for pyramid schemes in 2020...!?

PYer (3256)

@HahaYes @IreTheKID I think it's against repl.it's TOS to use it to make money. Not 100% sure though...

IreTheKID (275)

@CodingCactus Thanks!!! It took such a long time to get it done 😅

IreTheKID (275)

@CodingCactus it totally should. the page supports gifs!

CodingCactus (2481)

@IreTheKID it does, lol

btw, the get results button doesn't seem to work, you have to press enter?

IreTheKID (275)

@CodingCactus it's supposed to say what post the comment came from, but it doesn't work 😐

CodingCactus (2481)

@IreTheKID why doesn't the button work?

IreTheKID (275)

@CodingCactus idk flask is weird like that

Commander07 (30)

The button seems to be a html error that results in the button JUST being the text. @CodingCactus

CodeLongAndPros (915)

You should add some input sanitizers, I inserted '@CodeLongAndPros' and got a 500. .replace('@', '', 1)

IreTheKID (275)

@CodeLongAndPros sounds like a good idea! thanks! when i make the github repo ppl will be able to open pull requests for suggestions just like this one 😀

IreTheKID (275)

Hey guys, there's currently a bug that displays your recent comments as posts, I'm working on a fix right now, but I'm so lost... If you want to help, please fork this repl and head over to the GitHub repo here!

IreTheKID (275)

@PDanielY it shouldn't be! The flask server is up and running. Even if it is in development mode

AmazingMech2418 (661)

@IreTheKID It's back up now. I think you have to use a "keep alive" function with Flask. I'm not sure though because I always use Node instead of Python.

CodingCactus (2481)

will you make a new post when you add other features? If no, can you please tell me when you do, because this is really cool and I want to see the other features

IreTheKID (275)

@CodingCactus Totally! I'm working on a ton of stuff, there are so many ideas I have in my head; I want to make Repl-Customs into a tool that the entire community can use! :)

\(OwO)/

Nettakrim (366)

this is cool!
a "most popular posts" would be cool, also if you dont have a description it just says "None" next to your name

IreTheKID (275)

@Nettakrim Yeah, a leader board and other things like that are coming soon in the next version! Thanks!

syflexer (467)


My profile looks so kool on this and quick question how often does the statistics update Edit: also i found a bug when you click on the cycles or like when you joined it just leads to a blank white screen

IreTheKID (275)

@syflexer I'll fix the bug right now thanks! The stats update whenever you search or reload the page.

syflexer (467)

@IreTheKID also for refrence here is a screen shot of where it took me

[deleted]

wow i love this!
and i'm so excited to posts and comments

AmazingMech2418 (661)

Nice! However, it went down before I could look at my stats...

AmazingMech2418 (661)

I think you need to create a "keep alive" system for Flask servers. I don't think it just stays on like in Node.

IreTheKID (275)

@AmazingMech2418 hmmm... ok! I would need a nohup.out file and all that, but I'll try. Thanks for the suggestion!

AmazingMech2418 (661)

@IreTheKID You're welcome! Also, with the recent comments, I think you are using the wrong API. It shows the cycles and descriptions of the recent posts section.

AmazingMech2418 (661)

@IreTheKID Yep! You accidentally used the posts API twice.

IreTheKID (275)

@AmazingMech2418 OOOOOOOOOOOOOOOOOOOOOOOOOOOOh my gosh! what a lifesaver!!! how did I not catch this, I've had this problem for days! Thanks a bunch!

IreTheKID (275)

@AmazingMech2418 Would you mind going to the repo and posting the fix to the issue? I want you to have the credit in the repo, I've already fixed it in the repl.

AmazingMech2418 (661)

@IreTheKID I'm guessing you mean the GitHub repo. What exactly do you want me to do?

AmazingMech2418 (661)

@IreTheKID Now, I'm getting an error for some reason.

IreTheKID (275)

@AmazingMech2418 Post the solution to the issue in the GitHub repo. Like a code snippet or something. There's only one open.

IreTheKID (275)

@AmazingMech2418 I have no idea. I'm working on it now. It happened after I changed the API post-call like you said...

AmazingMech2418 (661)

@IreTheKID I see now... It isn't get_comments...

IreTheKID (275)

@AmazingMech2418 that isn't for the user object, tho. it's
await user.get_comments()

IreTheKID (275)

@AmazingMech2418 so idk what the problem is, but I need to fix it so that ppl can use the web app.

AmazingMech2418 (661)

@IreTheKID Try printing the objects you got to see if they are undefined for some reason. I would if I could but I just forked it and it says I need a secret key.

IreTheKID (275)

@AmazingMech2418 the secret key can be any 16 character hex key. import secrets and generate one with secrets.token_hex() it won't be the same as mine so it should just work for you.

IreTheKID (275)

@AmazingMech2418 It seems the problem is that the
user = await replit.get_user(name)
is returning None which raises the
'NoneType' has no attribute 'subscription'
error. I have no idea why it doesn't work. Seems like a problem with @mat1's repltalk class or function.

AmazingMech2418 (661)

@IreTheKID It is in the comments part. The None is because an error was thrown and the except statement makes it set it to None.

IreTheKID (275)

@AmazingMech2418 but what error is the question. I'll fork it so that I can print out the traceback and look at it closer.

AmazingMech2418 (661)

@IreTheKID

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/runner/Repl-Customs-v1/Repl-Customs/app.py", line 47, in application
    asyncio.run(get_user_object(str(query)))
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/runner/Repl-Customs-v1/Repl-Customs/app.py", line 21, in get_user_object
    raise e
  File "/home/runner/Repl-Customs-v1/Repl-Customs/app.py", line 16, in get_user_object
    comments = await user.get_comments(limit=5,order='new')
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/__init__.py", line 814, in get_comments
    _comments = await client._get_user_comments(
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/__init__.py", line 1182, in _get_user_comments
    return await self.perform_graphql(
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/__init__.py", line 966, in perform_graphql
    'query': str(query)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 89, in __str__
    output = 'query ' + str(self.field)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 67, in __str__
    value = builtin_to_graphql(value)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 7, in builtin_to_graphql
    value = str(item)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 72, in __str__
    output += str(value)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 53, in __str__
    output += str(item)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 72, in __str__
    output += str(value)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 67, in __str__
    value = builtin_to_graphql(value)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 7, in builtin_to_graphql
    value = str(item)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/repltalk/graphql.py", line 65, in __str__
    for field in item:
TypeError: 'type' object is not iterable
AmazingMech2418 (661)

@IreTheKID It is an issue in @mat1 's repltalk module. It is accidentally setting item to a class instead of an instantiation of a class.

IreTheKID (275)

@AmazingMech2418 welp...
I've never seen a traceback so long, so that's a first.

AmazingMech2418 (661)

@IreTheKID This is way too common of an issue in Python... I've already had to fix an error like that I think twice before in other people's repls...

IreTheKID (275)

@AmazingMech2418 so what do I do? I don't know how to contact mat1 and we've already pinged him in our comments, so... now what?

IreTheKID (275)

@AmazingMech2418 I'm just gonna put the get_posts() functions back the way it was and leave it for now. I'll go to the repltalk repo and open an issue there. Imma log off rn too. thanks for all your help! :)))

AmazingMech2418 (661)

@IreTheKID Do you have anything back from @mat1 on the bug?

IreTheKID (275)

@AmazingMech2418 Nope, I opened an issue about it here, but there haven't been any changes. :(

chippycoder08 (16)

Cool! Definitely upvoting this!!

HahaYes (893)

lol this project exploded pretty quick

IreTheKID (275)

@HahaYes I'm really glad it did, I spent sooo long on it! :))

Commander07 (30)

@IreTheKID I Have found a fix for your problem with the button the reason it wasn't working was not due to Flask or Python but HTML and the button was just the text I have attached a fixed piece of code which should work simply by replacing the HTML button (both the <i> and <input>). :D

<i class="col s12 btn btn-large waves-effect green waves-input-wrapper" style="
    padding: 0;
"><input class="col s12 waves-button-input" id="submit" name="submit" type="submit" value="Get Results" style="
    height: 100%;
    padding: 0;
"></i>
Commander07 (30)

The button code is broken the button is just the text for some reason.

rediar (292)

Doesn’t work on my iPad...

IreTheKID (275)

@rediar mobile support isn't there fully. sorry, that'll come in the next update! 😀

RohilPatel (799)

Materialize is good, but the select doesn't work in mobile

Bookie0 (2796)

Cool! Im excited for this!

JBYT27 (104)

This is AWESOME!!!!

PDanielY (967)

Why is there google analytics

IreTheKID (275)

@PDanielY well this is a big project so I want to know things like what browsers are used the most to visit the site so that I can optimize it for all users. and also looking at data is cool! (Mostly I want to know if its worth my time to make it mobile-compatible)

cgolden15 (189)

Amazing! Only problem I found was the get results button doesn't work and you have to click enter to search profiles. Definitely one of the best repls I've see in a while.

IreTheKID (275)

@cgolden15 Thanks! Idk why the "Get Results" button doesn't work consistently, The Flask wtform is weird like that I guess

NoelB33 (291)

Nothing happens when I click search..

Edit: never mind it worked after like 2 minutes of waiting

NoelB33 (291)

I did, I edited the post to say this but it just took like 2 minutes for anything to happen. @FunnyLamma

IreTheKID (275)

@NoelBryan Well, I hope you like it!

NoelB33 (291)

I do! The only thing is the recent comments are kinda broken @IreTheKID

IreTheKID (275)

@NoelBryan yea, the async request for the post title doesn't really work for whatever reason. Whether this is a problem with flask or the repltalk package, idk

adityaru (147)

Nice! also, when the project is open, my GitHub username is AR-JPEG

CodeLongAndPros (915)

Also, my picture is compressed. The dingo looks like a kangaroo. Mine is 1080*1920 though.