Jump to content

Calling all Forum Familiar / Web Developer-esque Nerds


Recommended Posts

So, I'm in the process of going through and re-doing the way in which we house the Nerd Fitness Leaderboards.

 

We originally did a list in a post that was just updated.  Then we moved to a big Google Doc that we embedded into the Post.

 

We however, eventually ran into an issue where the embedding stopped working, plus it's just sort of slow to load and kind of clunky IMO. 

 

So I've created a python script that queries our Google Doc, creates a nice post with all the formatting already in it, and I can just copy and paste it whenever I need to update it.

 

You can see an example of the new formatting here:

 

http://rebellion.nerdfitness.com/index.php?/topic/52404-front-squat-leaderboard/

 

I tried to get some nice formatting into the post to make it look more like columns, but the post editor seems to eat white space for breakfast.  From Google searching, it seems to be an HTML thing.  If anyone knows ways to fix that, I'm all ears. Also, I'm looking for feedback on how I make this better. 

 

Any and all feedback is appreciated. 

Link to comment

You're right, html treats whitespace differently from other characters.  If my memory serves it collapses all whitespace into a single space so 5 spaces/tabs/returns will all be rendered as just one single space.  The best way to create a table is to use the <table> html element or use div tags w/ some css to format them as tables; I'm not sure how much that helps since I'm not familiar with the inner workings of the forums

Northlander -- Viking Wannabe

"It is no use saying 'we are doing our best'.  You have got to succeed in doing what is necessary." - Churchill

 

Challenges: 1/2/Current

 

Pushups - 141 of 1000

14%
14%
Link to comment

I believe that the higher ups have disabled the table feature from posts.  Least I have yet to find a way to get it to work.  I'll maybe inquire with them further to find out why / if it can be enabled.  Thanks for the input.

 

 

You would be correct. Tables have been disabled even though they still show up under the "Special BBCode" button. The limited HTML and BBCode allowed in these forums will keep you from what you're aiming to do, but if you can convince staci (maybe bigm?) to allow it by member or something, I can help get something that would work.

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

You would be correct. Tables have been disabled even though they still show up under the "Special BBCode" button. The limited HTML and BBCode allowed in these forums will keep you from what you're aiming to do, but if you can convince staci (maybe bigm?) to allow it by member or something, I can help get something that would work.

 

I'm one of their favorites and they wouldn't let me. HTML stuff apparently screws up the database or somehting along those lines.

Massrandir, Barkûn, Swolórin, The Whey Pilgrim
500 / 330 / 625
Challenges: 19 20 21 22 23 24 25 26 27 28 29 31 32 34 35 36 39 41 42 45 46 47 48 49 Current Challenge
"No citizen has a right to be an amateur in the matter of physical training. What a disgrace it is for a man to grow old without ever seeing the beauty and strength of which his body is capable. " ~ Socrates
"Friends don't let friends squat high." ~ Chad Wesley Smith
"It's a dangerous business, Brodo, squatting to the floor. You step into the rack, and if you don't keep your form, there's no knowing where you might be swept off to." ~ Gainsdalf

Link to comment

I'm one of their favorites and they wouldn't let me. HTML stuff apparently screws up the database or somehting along those lines.

 

I had a feeling :( I remember when they switched over to the new board software, they disabled all of it and now all of my older posts, challenges, etc look terrible. From a database standpoint, I can somewhat see it, but that really depends on the kind of traffic you are getting compared to what you're running on the backend. Things have grown a lot over the past couple of years, but of course I have no idea what NF's hosting plan looks like.

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Out of curiosity, is it really just Spezzy and BigM that do ALL the maintenance and upkeep on NF?  That seems like a lot of work for just those two.  And is BigM even on the NF staff? 

 

BigM isn't on NF staff last I heard, but I do believe he has board powers that are close to spezzy. I think NF staff is mainly just 4 people, but they get a good bit of help and also contract work out as well. A lot of maintenance and upkeep is also handled by the countless mods the boards have, such as Gainsdalf. Although the power to turn on and off board functions as well as any kind of software upkeep (updates, upgrades, etc) probably fall mostly on spezzy and who she can designate it out to for help I would guess.

 

EDIT: All of what I said may need to be verified by someone that knows more than I do. This is simply how I think it is.

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Would a monospace font (e.g. courier) work, with . or _ for spacing?

Column 1.......|Column 2|Column 3...|

A user name....|....1345|Comment....|

 

The other solution would be to make a picture (e.g. screenshot of the spreadsheet) and post that. HTML does indeed eat up white space, and since the table bb code seems to be disabled those are pretty much your options.

"None of us can choose to be perfect, but all of us can choose to be better." - Lou Schuler, New Rules of Lifting for Women

Link to comment

Would a monospace font (e.g. courier) work, with . for spacing?

Column 1.......|Column 2|Column 3...|

A user name....|....1345|Comment....|

 

 

Thinking outside of the box there! Below is a sample using what you suggested.

 

 

Athlete             | Gender | Bodyweight | Current 1RM | Wilkes Points

-----------------------------------------------------------------------

AngelaTheGeek       | F      | 109kg      | 137kg       | 111.61

bofhgirl            | F      | 62.14kg    | 90.72kg     | 98.45

chairohkey          | M      | 113.4kg    | 165.56kg    | 96.57

This is Seth        | M      | 92kg       | 143kg       | 90.3

walt_mink           | M      | 115.67kg   | 154.68kg    | 89.74

Gainsdalf the Whey  | M      | 123kg      | 152kg       | 86.91

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Rooks,

 

With the above method, do you think you could have your Python script specify a number of characters per column and whatever is returned is padded with spaces up to the character limit, or if what is returned (name, etc) is above that limit it gets truncated?

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Rooks,

 

With the above method, do you think you could have your Python script specify a number of characters per column and whatever is returned is padded with spaces up to the character limit, or if what is returned (name, etc) is above that limit it gets truncated?

 

This sounds exactly like the pop quizzes one of my professors in school used to throw at us; he'd give us 15 minutes to write some script that outputs a data set in a given pattern.  I almost want to do it just for fun!

Northlander -- Viking Wannabe

"It is no use saying 'we are doing our best'.  You have got to succeed in doing what is necessary." - Churchill

 

Challenges: 1/2/Current

 

Pushups - 141 of 1000

14%
14%
Link to comment

Rooks,

 

With the above method, do you think you could have your Python script specify a number of characters per column and whatever is returned is padded with spaces up to the character limit, or if what is returned (name, etc) is above that limit it gets truncated?

I feel like my script already does that.  Here's a screen grab of the standard output.  But even if I change the font to courier, it is still eating the white space.  How did you get it not do that Wizard?  I'm wondering if it's because I'm using the bold and italics stuff. 

 

20syaa9.png

 

EDIT:  Nope.  It not the formatting stuff.  It's simply that if you paste something into the raw editor, it'll convert all your white space to nothing.  If you actually type out the spaces, it'll post properly.  So now the question is, can I get output that can be posted into the editor with the formatting already saved into it somehow.

Link to comment

Not sure how he did it, but I've done it in the past by putting a bunch of periods or underscores to take up the space and changed their color to white.

Just..........Like..........This

Massrandir, Barkûn, Swolórin, The Whey Pilgrim
500 / 330 / 625
Challenges: 19 20 21 22 23 24 25 26 27 28 29 31 32 34 35 36 39 41 42 45 46 47 48 49 Current Challenge
"No citizen has a right to be an amateur in the matter of physical training. What a disgrace it is for a man to grow old without ever seeing the beauty and strength of which his body is capable. " ~ Socrates
"Friends don't let friends squat high." ~ Chad Wesley Smith
"It's a dangerous business, Brodo, squatting to the floor. You step into the rack, and if you don't keep your form, there's no knowing where you might be swept off to." ~ Gainsdalf

Link to comment

My first thought was to use   but it looks like that element isn't allowed either. What if you were to paste it using the code "<>" button?

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

As for how I did it, I simply added the spaces in the reply itself, but if I copy the same thing from a text editor (Notepad++ in this case), mine maintains the spaces and pastes properly. I'm curious if when you copy it from the script output if the whitespace being copied is actually being copied as a single "tab" rather than "spaces".

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Pasting it using the code button didn't work. Here's my attampt using the white periods. Looks to work well, though the <> code is ugly.

Athlete............| Gender | Bodyweight | Current 1RM | Wilkes Points
----------------------------------------------------------------------
AngelaTheGeek......| ..F... | 109kg..... | 137kg...... | 111.61
bofhgirl...........| ..F... | 62.14kg... | 90.72kg.... | 98.45
chairohkey.........| ..M... | 113.4kg... | 165.56kg... | 96.57
This is Seth.......| ..M... | 92kg...... | 143kg...... | 90.3
walt_mink..........| ..M... | 115.67kg ..| 154.68kg... | 89.74
Gainsdalf the Whey | ..M... | 123kg..... | 152kg...... | 86.91

 
edit: I'm not a coder, but it would seem pretty straight forward to have the script count the number of characters in an entry, subtract that from the total allowed in that column, then enter the remainder as periods and have those bracketed by the white formatting bbcode. You then paste the script right into the <> code section. Code I used below:

 

 

{font="courier new", courier, monospace}Athlete{color=#ffffff}............{/color}| Gender | Bodyweight | Current 1RM | Wilkes Points{/font}

{font="courier new", courier, monospace}----------------------------------------------------------------------

AngelaTheGeek{color=#ffffff}......{/color}| {color=#ffffff}..{/color}F{color=#ffffff}...{/color} | 109kg{color=#ffffff}.....{/color} | 137kg{color=#ffffff}......{/color} | 111.61

bofhgirl{color=#ffffff}...........{/color}| {color=#ffffff}..{/color}F{color=#ffffff}...{/color} | 62.14kg{color=#ffffff}...{/color} | 90.72kg{color=#ffffff}....{/color} | 98.45

chairohkey{color=#ffffff}.........{/color}| {color=#ffffff}..{/color}M{color=#ffffff}...{/color} | 113.4kg{color=#ffffff}...{/color} | 165.56kg{color=#ffffff}...{/color} | 96.57

This is Seth{color=#ffffff}.......{/color}| {color=#ffffff}..{/color}M{color=#ffffff}...{/color} | 92kg{color=#ffffff}......{/color} | 143kg{color=#ffffff}......{/color} | 90.3

walt_mink{color=#ffffff}..........{/color}| {color=#ffffff}..{/color}M{color=#ffffff}...{/color} | 115.67kg {color=#ffffff}..{/color}| 154.68kg{color=#ffffff}...{/color} | 89.74

Gainsdalf the Whey | {color=#ffffff}..{/color}M{color=#ffffff}...{/color} | 123kg{color=#ffffff}.....{/color} | 152kg{color=#ffffff}......{/color} | 86.91{/font}

Massrandir, Barkûn, Swolórin, The Whey Pilgrim
500 / 330 / 625
Challenges: 19 20 21 22 23 24 25 26 27 28 29 31 32 34 35 36 39 41 42 45 46 47 48 49 Current Challenge
"No citizen has a right to be an amateur in the matter of physical training. What a disgrace it is for a man to grow old without ever seeing the beauty and strength of which his body is capable. " ~ Socrates
"Friends don't let friends squat high." ~ Chad Wesley Smith
"It's a dangerous business, Brodo, squatting to the floor. You step into the rack, and if you don't keep your form, there's no knowing where you might be swept off to." ~ Gainsdalf

Link to comment

Boom.  Completely re-worked.  Thank you so much for all the ideas guys.  I ended up having to use commas in the script instead of periods because my function was eating the periods inside the weights listed. 

 

Anyway, check out the results here and let me know your feedback. 

 

http://rebellion.nerdfitness.com/index.php?/topic/52404-front-squat-leaderboard/

Link to comment

You would be correct. Tables have been disabled even though they still show up under the "Special BBCode" button. The limited HTML and BBCode allowed in these forums will keep you from what you're aiming to do, but if you can convince staci (maybe bigm?) to allow it by member or something, I can help get something that would work.

 

Tables aren't 'disabled' perse. They are just broken. Have been since we switched to IP Board. Nuala and I tried fixing them a while back but to no avail. 

 

I'm one of their favorites and they wouldn't let me. HTML stuff apparently screws up the database or somehting along those lines.

 

 

I had a feeling :( I remember when they switched over to the new board software, they disabled all of it and now all of my older posts, challenges, etc look terrible. From a database standpoint, I can somewhat see it, but that really depends on the kind of traffic you are getting compared to what you're running on the backend. Things have grown a lot over the past couple of years, but of course I have no idea what NF's hosting plan looks like.

 

Yup. HTML does weird things with the boards, plus you know haxxors would wreak havoc with html enabled. 

 

 

Out of curiosity, is it really just Spezzy and BigM that do ALL the maintenance and upkeep on NF?  That seems like a lot of work for just those two.  And is BigM even on the NF staff? 

 

 

BigM isn't on NF staff last I heard, but I do believe he has board powers that are close to spezzy.

 

 

Not on paid staff but I still handle a lot of the amind-y issues for forum members, set up challenge boards, solve spam and troll issues etc, since spezzy is busy running the rest of NF. We have similar powers with the main difference being that spezzy has access to back end site stuff :)

 

 

Also good job rooks :)

"Pull the bar like you're ripping the head off a god-damned lion" - Donny Shankle

Link to comment

Boom.  Completely re-worked.  Thank you so much for all the ideas guys.  I ended up having to use commas in the script instead of periods because my function was eating the periods inside the weights listed. 

 

Anyway, check out the results here and let me know your feedback. 

 

http://rebellion.nerdfitness.com/index.php?/topic/52404-front-squat-leaderboard/

 

 

Looks great! See, nerds can accomplish any workaround.

 

 

Tables aren't 'disabled' perse. They are just broken. Have been since we switched to IP Board. Nuala and I tried fixing them a while back but to no avail. 

 

 

Meh....tables are from the old internet days anyway. Give me my div tags and the ability to use inline styles and I'd be happy. I'll play nice in the HTML playground. I'm not just any lousy haxxor, I'm A 1337 H4x0r!!! :pride:

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

 

Meh....tables are from the old internet days anyway. Give me my div tags and the ability to use inline styles and I'd be happy. I'll play nice in the HTML playground. I'm not just any lousy haxxor, I'm A 1337 H4x0r!!! :pride:

 

 

HACK THE PLANET! HACK THE PLANET!!!

"Pull the bar like you're ripping the head off a god-damned lion" - Donny Shankle

Link to comment

Meh....tables are from the old internet days anyway. Give me my div tags and the ability to use inline styles and I'd be happy. I'll play nice in the HTML playground. I'm not just any lousy haxxor, I'm A 1337 H4x0r!!! :pride:

 

Tables still have their place; they shouldn't be used for page layout or anything like that but if you're looking to display tabular or grid data they're still the way to go (which was their intended purpose anyway).

Northlander -- Viking Wannabe

"It is no use saying 'we are doing our best'.  You have got to succeed in doing what is necessary." - Churchill

 

Challenges: 1/2/Current

 

Pushups - 141 of 1000

14%
14%
Link to comment

HACK THE PLANET! HACK THE PLANET!!!

 

 

If you want a seriously righteous hack, you should score one of those Gibsons!

 

 

Tables still have their place; they shouldn't be used for page layout or anything like that but if you're looking to display tabular or grid data they're still the way to go (which was their intended purpose anyway).

 

 

I'll give you that, and yeah I guess I was referring to the days when people would use them for page layout. Hell, I was one of them way back when since my mind worked in columns and rows.

Level 6 Wizard of Beer Warrior
STR 21.25 | DEX 5.75 | STA 7.75 | CON 3.50 | WIS 9.50 | CHA 3.25
Twitter | Epic Trip | Current Challenge
Previous Challenges: 1 2 3 4 5
*the warrior formerly known as icedtrip and former dothraki god of thunder furyan*

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

New here? Please check out our Privacy Policy and Community Guidelines