a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by veen
veen  ·  3143 days ago  ·  link  ·    ·  parent  ·  post: Hubski prototypical API is here

It took me embarrassingly long to get the hang of combining Python 3 and the API, but once I understood what I was doing I made this small script. I put it up on Github. Any criticism is welcome, I'm not a Python expert.

The script that gives you a sorted list of everyone who voted on a post or comment. For example, for rob's post it returns this in the command line:

  Pub ID: 266825

Title: Hubski prototypical API is here

List of votes, sorted from first voter to last:

1: thenewgreen

2: War

3: mk

4: caelum19

5: camarillobrillo

6: forwardslash

7: nowaypablo

8: thundara

9: StJohn

10: OftenBen

11: demure

12: am_Unition

13: ihya1324

14: veen

15: whanhee

16: tauta_krypta

17: NoTroop

18: lelibertaire

19: Cumol

20: querx

21: KittehCult

22: aeromill

23: GodOfAtheism

Press Enter to exit...

It ain't perfect but I think it's cool that I conjured this up in a few hours.

insomniasexx or rob, how can I get a simple .py like this up on the web as something that runs on a server? As in, an online version of the command line that runs my file. I tried some of the services from this free Github student pack but I am such a webdev noob that I don't have a clue what does what. I've heard of Docker, is that what I'm looking for?





beezneez  ·  3142 days ago  ·  link  ·  

Docker is like github, but for entire operating systems. It's a really cool feat of engineering, but there aren't a lot of resources out there for it as you would expect. I'll take a look at your client API and see if there could be changes.

thundara  ·  3141 days ago  ·  link  ·  

Sort of... it's power is as version controlled packaging / deployment. The config files let you say "install all of these dependencies, run services for a reverse proxy / search engine / database, hook them together like so, run X copies across a farm of machines, and expose these ports / directories within their file systems."

What sets it apart from other similar programs (Puppet, Chef, Ansible, Vagrant) is that instead of running those programs in virtual machines or the hose machine, they are run within containers. This means less overhead than a VM, but also somewhat different security concerns

rinx  ·  3128 days ago  ·  link  ·  

I ended up writing a chrome extension that does something similar. I don't know javascript, chrome, or really any webdev stuff, so it's ugly, but I'm happy to share it out if you want it.

It looks like this when you mouseover a hubwheel -

veen  ·  3128 days ago  ·  link  ·  

That's much more user friendly than what I conjured up.

I, too, am a total webdev noob. I'm currently moving my site to a virtual private server, so I can do some webdev on there too. The goal is to build a simple web app, learning Django along the way. I've got a page that displays text, now all I need to do is put all the useful stuff in there...

rinx  ·  3128 days ago  ·  link  ·  

Something that snagged me (sorry if you noticed this already) but this list is all shares. So if I share / unshare your post it will say rinx twice. I clicked / unclicked the post I'm replying to a bunch to demonstrate.

veen  ·  3128 days ago  ·  link  ·  

It's the reason I also list whether it is an upvote or down vote in the newest version of the code. At first I only displayed upvotes, but that meant that a post could display more upvotes than its counter. Instead of adding a check for up-down combinations, I just added '...voted up'.

beezneez  ·  3142 days ago  ·  link  ·  

Here's a non-command line fork of your project; I hope you find it helpful: https://github.com/imbellish/HubskiScript/blob/master/Hubski/Hubski.py

veen  ·  3142 days ago  ·  link  ·  

Thanks! Very neat. I'll try it out later. I was thinking of putting the pubs in Python classes, but I wanted to build a simple script first.

rob05c  ·  3143 days ago  ·  link  ·  

Docker is completely unrelated.

You can write a basic Python web server. Example, Docs.

Alternatively, if you want a static web page, you can rewrite your script in Javascript. Then, you can serve the html+javascript from any dumb web server, e.g. Github Pages. Tutorial. If you want to go the Javascript route, let me know, and I'll add CORS headers to the API server, which you need to make an XSS request.