Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Upvotes

Can I set a default to always up-vote my own forum posts? It'd save me a lot of time...

You want to give a up-vote to your self ? well, i dont think there is something like that at least you make it and crack to their website and paste the code xd

4 Answers

Yes, yes I do. It amuses me to no end. :P

: p hey xd i saw that you have 2.6k points on CSS. Well did you learn alot by it ? i mean can do do whatever layout you want?

The points are a motivator and yes I can make most things work. However even though I have a satchel full of points, I would like more practice and maybe even some graded tasks that the members / teachers of treehouse would see and comment on...

So yes, I can make some neat things but I need more practice to do it efficiently.

i think i know what you mean . I have this thing that i learn i can do whatever i want , but i need to look for the code in the code editor to remember everything . Well for me it get a bit boring and everything because i did 35 websites but with old HTML learned in different website and form Youtube . what i see here all these media queries , fluid layouts etc.. its just amaing and hard to update because i need more practice and everything .

Oh bdw i see you have js and ruby on 1k points so you had done some work on it . And well can you do a facebook-like website ? like login , register , send message etc..? and add interactivity like gallery etc..?

I'm not sure how you could go about automating this, but running the following JavaScript in the console should upvote every post of yours on the page.

jQuery('.discussion-answer')
    .has('.byline .featurette[data-profile-name="michaelnickey"]')
    .find('.vote-up a')
       .not('.voted')
    .each(function(){
        jQuery(this).click();
    });

Yeah , but , dont they have a kind of protection for the code ? Did you hear about the twitter or my space whatever it was when a guy coudnt find a girl so he made a code and that added everybody who visited him or he visited them , added them autaomaticly ? after cople of hours he had like million friends and he get 3 years in Jail i think not sure , dont remember it but im pretty sure you cant break into a webpages code : p If people could activate their codes on any webpages , i dont imagine the internet webpages word . You can make you own CSS and apply to every website if you have a purpose eg , you can see the color black so you make a CSS that set the color to e.g red and you apply , same as you can disactivate JS.

I do recall reading about that. It had something to do with the CSS on his page, I'm pretty sure. MySpace let(s) you use CSS to customize your profile page, and the guy used it to send a GET request to a URL that would make anyone who visited his page follow him, or whatever the MySpace equivalent is. Maybe it wasn't exactly that, but you get the idea.

But this is a little different. There, three parties were involved: the hacker, the people who inadvertently followed him, and MySpace. But here, it's just two parties: the user and Treehouse. Since the script is running on my behalf, and since it's not affecting anyone but me, and since it's doing everything I can do (just faster) and no more, I personally think it's a legal script. Please, though, correct me if I'm wrong.

With that being said, though, I do find it a little funny that we can upvote our own posts. I mean, that's free points whenever we answer a question. But that's Treehouse's call, not mine.

The thingy from myspace , i dont remember who was it , but i think i heared it from lynda.com from somewhere or maybe from youtbue not sure. Its just that he did a code and later on he pasted that code and had added everyone and everyone who visited him or he did and he had a million friends ...

But you can apply CSS to any webpage you want , im pretty sure 99% . Same if you go to inspect elements and you see the code , you can change it too, in the live mode so you can make a stylesheet and apply it to every website you come , thats legal because it onnly affects you .

But well , saying that if he can get an up-vode with the code he may unblock alos wideos for gold premium? if you know what i mean , if he can mess with the up-vote,he could mess up with premium things . I m not targeting him but im saying owerall that i dont think anyone is allowed to change or do anything to change the interactivity of the website and make it change in the vay like up-votes if you get what i mean : P i hope you did it understand because my english inst too good : /

It's okay, I understood you. I'll try to explain this step by step so that you understand, because it's a pretty good lesson in the world of authentication:

When I try to do something that I'm allowed to do (like upvote a comment on Treehouse), my browser sends a request to Treehouse (the server). Treehouse checks to make sure that I'm allowed to do that. Since I'm allowed to upvote a comment, they increase the post upvotes by 1, award a point to the comment author, and respond to me and tell me that I've upvoted a comment.

When I try to watch a Pro video (I'm not Pro, by the way, so I'm not allowed to do that), my browser sends a request to Treehouse for me to watch the video. Treehouse decides that I'm not allowed to watch that, and responds back and says that in order to watch it, I should upgrade my account and go Pro.

My little script works exactly the same way that I do. When I run it, it clicks the upvote button on every comment of mine on the page. That sends a request to Treehouse, which decides if I should be allowed to take that action. Since I'm allowed to upvote comments, it responds back and tells my script that it can upvote posts.

But if I wrote a script that did the same thing for Pro videos, it would send a request for a Pro video, but Treehouse would decide that I'm not allowed to watch those videos, and would tell the script so.

TL;DR The authentication happens on Treehouse's side, not on the client-side. No JavaScript I write can do anything without Treehouse's permission. Since Treehouse lets me upvote comments, any JavaScript I run in the console can also upvote comments. But since Treehouse doesn't let me watch Pro videos, any JavaScript I run in the console also cannot access those videos.