News:

And we're back!

Main Menu

DSB's Bored Programming Dump

Started by DontSayBanana, October 05, 2016, 08:44:59 PM

Previous topic - Next topic

DontSayBanana

Decided I need to start brushing off some of the programming skills, so this is partly an idea dump, partly an apology/disclaimer for some of the weird stuff I find myself doing, such as tonight's experiment.

Knowing that election night is coming up in a couple of weeks, it's going to be annoying refreshing the entire page for the election megathread to keep up with the barrage of posting, so I decided tonight was a great time to work on my web skills, so I'm writing a page to function like Reddit's live thread feature-

1) Scrape a thread for replies periodically (this is where the apology part comes in- vM, if you're wondering why you're getting bot-like page requests, this is where it's coming from; I'll keep the frequency of polling down because it's not like you guys are that active).
2) Add replies to the page.
3) Try some AJAX and JQuery trickery to make the page keep going without constantly refreshing.

It was this or ASCII solitaire.
Experience bij!

HisMajestyBOB

What language are you using? I've been teaching myself webscraping using Python and Selenium, Beautiful Group and Requests, but progress has been slow.
Three lovely Prada points for HoI2 help

DontSayBanana

Quote from: HisMajestyBOB on December 25, 2016, 08:49:38 AM
What language are you using? I've been teaching myself webscraping using Python and Selenium, Beautiful Group and Requests, but progress has been slow.

Primarily straight-up Javascript, because I'd rather get the nuts and bolts of what XHRs can and can't do before I go burying that away by just using libraries.
Experience bij!

DontSayBanana

#3
So this is one of those things where coding and programming kinda diverge, but the girlfriend has been complaining about her graphic design stuff not being marketable and expressing a desire to learn at least some core web technologies, so I'm dumping here the thing I'm planning on doing with her as something fun that can get her out of the "follow these instructions to the letter" rut that can come up from following Internet tutorials.

Found one of those silly little Facebook flowcharts and realized there's only a degree or two of separation between those and the clickbait quizzes that are all over social media.  Particularly, it was this one:


So what I'm going to do is try to use converting this to a clickbait quiz as a quick scratch project/refresher for the three core web technologies (HTML, CSS, Javascript).  How I'm going to do it is this:

1: Make each question and landing page pure HTML, each "answer" being an href (basically, treating this image as a sitemap).
2: Use CSS to make it more readable, introduce the centering "hack" (since it's arguably the most common CSS hack and is a good spot to illustrate positioning and flow), and make the hrefs look like buttons.
3: Stitch the logos together as a CSS sprite sheet, convert the hrefs to form buttons, and maybe convert it to a frameset iframe to introduce the idea of reducing page loads by preloading resources.
4: Deal with the DOM tree of HTML to hide and show elements on a single page without pulling from a hidden frame.
5: Beginner's AJAX, how to use a XHR to dynamically alter elements and drastically reduce the web page's footprint.
Experience bij!