Yes - it is up to the owners of those sites to give permission.
If they agree to having their pages displayed that way then there is no question about whether it is legal or not.
If they do not...
Do you care if the same person votes twice? Just madly clicks away at the "Vote" button?
Your algorithm sounds good
not using jquery nor wordpress I can only guess if this would work but basically add another ajax call ...
To make code appear verbatim, write is as a .txt file and include it conditionally. In this case when the user is logged in the login form .txt is not