loading


WATCH THIS VIDEO IN HD!
This instructable show you how to make the instructables robot start the Harlem Shake (with music playing) and, when the bass drops, make the whole sight go crazy. Internet Explorer and Firefox Versions Coming Soon. This is just for chrome for now.
What did you make? I made a python program that is 914 lines long that automatically goes to the website you program it to (it goes straight to instructables.com if you don't follow my steps to edit the code) and makes the site do the harlem shake. In the instructables version, it makes the instructables robot start the dance and then everything else joins in.
How did you make it? I made it by taking a little bit of time each day to work on the program. I am just learning java so I spent hours on end looking through python manuals and code directories. My plans developed as I worked on it and it went from a 12,000 line long program to a 914 line long program (I found a few shortcuts).
Where did you make it? I made this entire project at home, spending a few hours out of my homework time on it (bad idea). I had to balance extracurricular activities, homework and this project, in fact, I should probably be doing my AP Computer Science homework right now...
What did you learn? Over the course of this project, I pretty much learned an entire new language (apart from similarities to java). I also learned a lot from having to debug my program. As a new python programmer, I had many errors that I had to work around and learn from. I am extremely proud that I got this program done before the Harlem Shake became a thing of the past. If I had to do it again, I would try to compress the code so that it would be easier to program.

Step 1: The python program

This took many long hours to complete, but constructive criticism would be great, especially if you are a python programmer that can help to condense the code.
The following is the python code:

import ctypes
import time
import webbrowser
webbrowser.open('http://www.instructables.com')


LONG = ctypes.c_long
DWORD = ctypes.c_ulong
ULONG_PTR = ctypes.POINTER(DWORD)
WORD = ctypes.c_ushort

class MOUSEINPUT(ctypes.Structure):
    _fields_ = (('dx', LONG),
                ('dy', LONG),
                ('mouseData', DWORD),
                ('dwFlags', DWORD),
                ('time', DWORD),
                ('dwExtraInfo', ULONG_PTR))

class KEYBDINPUT(ctypes.Structure):
    _fields_ = (('wVk', WORD),
                ('wScan', WORD),
                ('dwFlags', DWORD),
                ('time', DWORD),
                ('dwExtraInfo', ULONG_PTR))

class HARDWAREINPUT(ctypes.Structure):
    _fields_ = (('uMsg', DWORD),
                ('wParamL', WORD),
                ('wParamH', WORD))

class _INPUTunion(ctypes.Union):
    _fields_ = (('mi', MOUSEINPUT),
                ('ki', KEYBDINPUT),
                ('hi', HARDWAREINPUT))

class INPUT(ctypes.Structure):
    _fields_ = (('type', DWORD),
                ('union', _INPUTunion))

def SendInput(*inputs):
    nInputs = len(inputs)
    LPINPUT = INPUT * nInputs
    pInputs = LPINPUT(*inputs)
    cbSize = ctypes.c_int(ctypes.sizeof(INPUT))
    return ctypes.windll.user32.SendInput(nInputs, pInputs, cbSize)

INPUT_MOUSE = 0
INPUT_KEYBOARD = 1
INPUT_HARDWARD = 2

def Input(structure):
    if isinstance(structure, MOUSEINPUT):
        return INPUT(INPUT_MOUSE, _INPUTunion(mi=structure))
    if isinstance(structure, KEYBDINPUT):
        return INPUT(INPUT_KEYBOARD, _INPUTunion(ki=structure))
    if isinstance(structure, HARDWAREINPUT):
        return INPUT(INPUT_HARDWARE, _INPUTunion(hi=structure))
    raise TypeError('Cannot create INPUT structure!')

WHEEL_DELTA = 120
XBUTTON1 = 0x0001
XBUTTON2 = 0x0002
MOUSEEVENTF_ABSOLUTE = 0x8000
MOUSEEVENTF_HWHEEL = 0x01000
MOUSEEVENTF_MOVE = 0x0001
MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000
MOUSEEVENTF_LEFTDOWN = 0x0002
MOUSEEVENTF_LEFTUP = 0x0004
MOUSEEVENTF_RIGHTDOWN = 0x0008
MOUSEEVENTF_RIGHTUP = 0x0010
MOUSEEVENTF_MIDDLEDOWN = 0x0020
MOUSEEVENTF_MIDDLEUP = 0x0040
MOUSEEVENTF_VIRTUALDESK = 0x4000
MOUSEEVENTF_WHEEL = 0x0800
MOUSEEVENTF_XDOWN = 0x0080
MOUSEEVENTF_XUP = 0x0100

def MouseInput(flags, x, y, data):
    return MOUSEINPUT(x, y, data, flags, 0, None)

VK_LBUTTON = 0x01               # Left mouse button
VK_RBUTTON = 0x02               # Right mouse button
VK_CANCEL = 0x03                # Control-break processing
VK_MBUTTON = 0x04               # Middle mouse button (three-button mouse)
VK_XBUTTON1 = 0x05              # X1 mouse button
VK_XBUTTON2 = 0x06              # X2 mouse button
VK_BACK = 0x08                  # BACKSPACE key
VK_TAB = 0x09                   # TAB key
VK_CLEAR = 0x0C                 # CLEAR key
VK_RETURN = 0x0D                # ENTER key
VK_SHIFT = 0x10                 # SHIFT key
VK_CONTROL = 0x11               # CTRL key
VK_MENU = 0x12                  # ALT key
VK_PAUSE = 0x13                 # PAUSE key
VK_CAPITAL = 0x14               # CAPS LOCK key
VK_KANA = 0x15                  # IME Kana mode
VK_HANGUL = 0x15                # IME Hangul mode
VK_JUNJA = 0x17                 # IME Junja mode
VK_FINAL = 0x18                 # IME final mode
VK_HANJA = 0x19                 # IME Hanja mode
VK_KANJI = 0x19                 # IME Kanji mode
VK_ESCAPE = 0x1B                # ESC key
VK_CONVERT = 0x1C               # IME convert
VK_NONCONVERT = 0x1D            # IME nonconvert
VK_ACCEPT = 0x1E                # IME accept
VK_MODECHANGE = 0x1F            # IME mode change request
VK_SPACE = 0x20                 # SPACEBAR
VK_PRIOR = 0x21                 # PAGE UP key
VK_NEXT = 0x22                  # PAGE DOWN key
VK_END = 0x23                   # END key
VK_HOME = 0x24                  # HOME key
VK_LEFT = 0x25                  # LEFT ARROW key
VK_UP = 0x26                    # UP ARROW key
VK_RIGHT = 0x27                 # RIGHT ARROW key
VK_DOWN = 0x28                  # DOWN ARROW key
VK_SELECT = 0x29                # SELECT key
VK_PRINT = 0x2A                 # PRINT key
VK_EXECUTE = 0x2B               # EXECUTE key
VK_SNAPSHOT = 0x2C              # PRINT SCREEN key
VK_INSERT = 0x2D                # INS key
VK_DELETE = 0x2E                # DEL key
VK_HELP = 0x2F                  # HELP key
VK_LWIN = 0x5B                  # Left Windows key (Natural keyboard)
VK_RWIN = 0x5C                  # Right Windows key (Natural keyboard)
VK_APPS = 0x5D                  # Applications key (Natural keyboard)
VK_SLEEP = 0x5F                 # Computer Sleep key
VK_NUMPAD0 = 0x60               # Numeric keypad 0 key
VK_NUMPAD1 = 0x61               # Numeric keypad 1 key
VK_NUMPAD2 = 0x62               # Numeric keypad 2 key
VK_NUMPAD3 = 0x63               # Numeric keypad 3 key
VK_NUMPAD4 = 0x64               # Numeric keypad 4 key
VK_NUMPAD5 = 0x65               # Numeric keypad 5 key
VK_NUMPAD6 = 0x66               # Numeric keypad 6 key
VK_NUMPAD7 = 0x67               # Numeric keypad 7 key
VK_NUMPAD8 = 0x68               # Numeric keypad 8 key
VK_NUMPAD9 = 0x69               # Numeric keypad 9 key
VK_MULTIPLY = 0x6A              # Multiply key
VK_ADD = 0x6B                   # Add key
VK_SEPARATOR = 0x6C             # Separator key
VK_SUBTRACT = 0x6D              # Subtract key
VK_DECIMAL = 0x6E               # Decimal key
VK_DIVIDE = 0x6F                # Divide key
VK_F1 = 0x70                    # F1 key
VK_F2 = 0x71                    # F2 key
VK_F3 = 0x72                    # F3 key
VK_F4 = 0x73                    # F4 key
VK_F5 = 0x74                    # F5 key
VK_F6 = 0x75                    # F6 key
VK_F7 = 0x76                    # F7 key
VK_F8 = 0x77                    # F8 key
VK_F9 = 0x78                    # F9 key
VK_F10 = 0x79                   # F10 key
VK_F11 = 0x7A                   # F11 key
VK_F12 = 0x7B                   # F12 key
VK_F13 = 0x7C                   # F13 key
VK_F14 = 0x7D                   # F14 key
VK_F15 = 0x7E                   # F15 key
VK_F16 = 0x7F                   # F16 key
VK_F17 = 0x80                   # F17 key
VK_F18 = 0x81                   # F18 key
VK_F19 = 0x82                   # F19 key
VK_F20 = 0x83                   # F20 key
VK_F21 = 0x84                   # F21 key
VK_F22 = 0x85                   # F22 key
VK_F23 = 0x86                   # F23 key
VK_F24 = 0x87                   # F24 key
VK_NUMLOCK = 0x90               # NUM LOCK key
VK_SCROLL = 0x91                # SCROLL LOCK key
VK_LSHIFT = 0xA0                # Left SHIFT key
VK_RSHIFT = 0xA1                # Right SHIFT key
VK_LCONTROL = 0xA2              # Left CONTROL key
VK_RCONTROL = 0xA3              # Right CONTROL key
VK_LMENU = 0xA4                 # Left MENU key
VK_RMENU = 0xA5                 # Right MENU key
VK_BROWSER_BACK = 0xA6          # Browser Back key
VK_BROWSER_FORWARD = 0xA7       # Browser Forward key
VK_BROWSER_REFRESH = 0xA8       # Browser Refresh key
VK_BROWSER_STOP = 0xA9          # Browser Stop key
VK_BROWSER_SEARCH = 0xAA        # Browser Search key
VK_BROWSER_FAVORITES = 0xAB     # Browser Favorites key
VK_BROWSER_HOME = 0xAC          # Browser Start and Home key
VK_VOLUME_MUTE = 0xAD           # Volume Mute key
VK_VOLUME_DOWN = 0xAE           # Volume Down key
VK_VOLUME_UP = 0xAF             # Volume Up key
VK_MEDIA_NEXT_TRACK = 0xB0      # Next Track key
VK_MEDIA_PREV_TRACK = 0xB1      # Previous Track key
VK_MEDIA_STOP = 0xB2            # Stop Media key
VK_MEDIA_PLAY_PAUSE = 0xB3      # Play/Pause Media key
VK_LAUNCH_MAIL = 0xB4           # Start Mail key
VK_LAUNCH_MEDIA_SELECT = 0xB5   # Select Media key
VK_LAUNCH_APP1 = 0xB6           # Start Application 1 key
VK_LAUNCH_APP2 = 0xB7           # Start Application 2 key
VK_OEM_1 = 0xBA                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the ';:' key
VK_OEM_PLUS = 0xBB              # For any country/region, the '+' key
VK_OEM_COMMA = 0xBC             # For any country/region, the ',' key
VK_OEM_MINUS = 0xBD             # For any country/region, the '-' key
VK_OEM_PERIOD = 0xBE            # For any country/region, the '.' key
VK_OEM_2 = 0xBF                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the '/?' key
VK_OEM_3 = 0xC0                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the '`~' key
VK_OEM_4 = 0xDB                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the '[{' key
VK_OEM_5 = 0xDC                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the '\|' key
VK_OEM_6 = 0xDD                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the ']}' key
VK_OEM_7 = 0xDE                 # Used for miscellaneous characters; it can vary by keyboard.                                # For the US standard keyboard, the 'single-quote/double-quote' key
VK_OEM_8 = 0xDF                 # Used for miscellaneous characters; it can vary by keyboard.
VK_OEM_102 = 0xE2               # Either the angle bracket key or the backslash key on the RT 102-key keyboard
VK_PROCESSKEY = 0xE5            # IME PROCESS key
VK_PACKET = 0xE7                # Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
VK_ATTN = 0xF6                  # Attn key
VK_CRSEL = 0xF7                 # CrSel key
VK_EXSEL = 0xF8                 # ExSel key
VK_EREOF = 0xF9                 # Erase EOF key
VK_PLAY = 0xFA                  # Play key
VK_ZOOM = 0xFB                  # Zoom key
VK_PA1 = 0xFD                   # PA1 key
VK_OEM_CLEAR = 0xFE             # Clear key

KEYEVENTF_EXTENDEDKEY = 0x0001
KEYEVENTF_KEYUP = 0x0002
KEYEVENTF_SCANCODE = 0x0008
KEYEVENTF_UNICODE = 0x0004

KEY_0 = 0x30
KEY_1 = 0x31
KEY_2 = 0x32
KEY_3 = 0x33
KEY_4 = 0x34
KEY_5 = 0x35
KEY_6 = 0x36
KEY_7 = 0x37
KEY_8 = 0x38
KEY_9 = 0x39
KEY_A = 0x41
KEY_B = 0x42
KEY_C = 0x43
KEY_D = 0x44
KEY_E = 0x45
KEY_F = 0x46
KEY_G = 0x47
KEY_H = 0x48
KEY_I = 0x49
KEY_J = 0x4A
KEY_K = 0x4B
KEY_L = 0x4C
KEY_M = 0x4D
KEY_N = 0x4E
KEY_O = 0x4F
KEY_P = 0x50
KEY_Q = 0x51
KEY_R = 0x52
KEY_S = 0x53
KEY_T = 0x54
KEY_U = 0x55
KEY_V = 0x56
KEY_W = 0x57
KEY_X = 0x58
KEY_Y = 0x59
KEY_Z = 0x5A

import serial
import codecs
import ctypes
import time
from time import sleep

SendInput = ctypes.windll.user32.SendInput

PUL = ctypes.POINTER(ctypes.c_ulong)
class KeyBdInput(ctypes.Structure):
    _fields_ = [("wVk", ctypes.c_ushort),
                ("wScan", ctypes.c_ushort),
                ("dwFlags", ctypes.c_ulong),
                ("time", ctypes.c_ulong),
                ("dwExtraInfo", PUL)]

class HardwareInput(ctypes.Structure):
    _fields_ = [("uMsg", ctypes.c_ulong),
                ("wParamL", ctypes.c_short),
                ("wParamH", ctypes.c_ushort)]

class MouseInput(ctypes.Structure):
    _fields_ = [("dx", ctypes.c_long),
                ("dy", ctypes.c_long),
                ("mouseData", ctypes.c_ulong),
                ("dwFlags", ctypes.c_ulong),
                ("time",ctypes.c_ulong),
                ("dwExtraInfo", PUL)]

class Input_I(ctypes.Union):
    _fields_ = [("ki", KeyBdInput),
                 ("mi", MouseInput),
                 ("hi", HardwareInput)]

class Input(ctypes.Structure):
    _fields_ = [("type", ctypes.c_ulong),
                ("ii", Input_I)]

def PressKey(hexKeyCode):

    extra = ctypes.c_ulong(0)
    ii_ = Input_I()
    ii_.ki = KeyBdInput( hexKeyCode, 0x48, 0, 0, ctypes.pointer(extra) )
    x = Input( ctypes.c_ulong(1), ii_ )
    ctypes.windll.user32.SendInput(1, ctypes.pointer(x), ctypes.sizeof(x))

def ReleaseKey(hexKeyCode):

    extra = ctypes.c_ulong(0)
    ii_ = Input_I()
    ii_.ki = KeyBdInput( hexKeyCode, 0x48, 0x0002, 0, ctypes.pointer(extra) )
    x = Input( ctypes.c_ulong(1), ii_ )
    ctypes.windll.user32.SendInput(1, ctypes.pointer(x), ctypes.sizeof(x))




def KeybdInput(code, flags):
    return KEYBDINPUT(code, code, flags, 0, None)

def HardwareInput(message, parameter):
    return HARDWAREINPUT(message & 0xFFFFFFFF,
                         parameter & 0xFFFF,
                         parameter >> 16 & 0xFFFF)

def Mouse(flags, x=0, y=0, data=0):
    return Input(MouseInput(flags, x, y, data))

def Keyboard(code, flags=0):
    return Input(KeybdInput(code, flags))

def Hardware(message, parameter=0):
    return Input(HardwareInput(message, parameter))


#pressFunctions##################
def PA():
    PressKey(KEY_A)
def PB():
    PressKey(KEY_B)
def PC():
    PressKey(KEY_C)
def PD():
    PressKey(KEY_D)
def PE():
    PressKey(KEY_E)
def PF():
    PressKey(KEY_F)
def PG():
    PressKey(KEY_G)
def PH():
    PressKey(KEY_H)
def PI():
    PressKey(KEY_I)
def PJ():
    PressKey(KEY_J)
def PK():
    PressKey(KEY_K)
def PL():
    PressKey(KEY_L)
def PM():
    PressKey(KEY_M)
def PN():
    PressKey(KEY_N)
def PO():
    PressKey(KEY_O)
def PP():
    PressKey(KEY_P)
def PQ():
    PressKey(KEY_Q)
def PR():
    PressKey(KEY_R)
def PS():
    PressKey(KEY_S)
def PT():
    PressKey(KEY_T)
def PU():
    PressKey(KEY_U)
def PV():
    PressKey(KEY_V)
def PW():
    PressKey(KEY_W)
def PX():
    PressKey(KEY_X)
def PY():
    PressKey(KEY_Y)
def PZ():
    PressKey(KEY_Z)
def PCTRL():
    PressKey(VK_CONTROL)
def PSHIFT():
    PressKey(VK_SHIFT)
def PCOLON():
    PressKey(VK_OEM_1)
def PQUOTE():
    PressKey(VK_OEM_7)
def POPENBRACKET():
    PressKey(VK_OEM_4)
def PCLOSEBRACKET():
    PressKey(VK_OEM_6)
def PBACKSLASH():
    PressKey(VK_OEM_2)
def PPLUS():
    PressKey(VK_OEM_PLUS)
def PMINUS():
    PressKey(VK_OEM_MINUS)
def P0():
    PressKey(KEY_0)
def P1():
    PressKey(KEY_1)
def P2():
    PressKey(KEY_2)
def P3():
    PressKey(KEY_3)
def P4():
    PressKey(KEY_4)
def P5():
    PressKey(KEY_5)
def P6():
    PressKey(KEY_6)
def P7():
    PressKey(KEY_7)
def P8():
    PressKey(KEY_8)
def P9():
    PressKey(KEY_9)
def PSPACE():
    PressKey(VK_SPACE)
def PENTER():
    PressKey(VK_RETURN)
def PPERIOD():
    PressKey(VK_OEM_PERIOD)
def PCOMMA():
    PressKey(VK_OEM_COMMA)
def PFOREWARDSLASH():
    PressKey(VK_OEM_5)
def PF12():
    PressKey(VK_F12)
################################


#releaseFunctions#################
def RA():
    ReleaseKey(KEY_A)
def RB():
    ReleaseKey(KEY_B)
def RC():
    ReleaseKey(KEY_C)
def RD():
    ReleaseKey(KEY_D)
def RE():
    ReleaseKey(KEY_E)
def RF():
    ReleaseKey(KEY_F)
def RG():
    ReleaseKey(KEY_G)
def RH():
    ReleaseKey(KEY_H)
def RI():
    ReleaseKey(KEY_I)
def RJ():
    ReleaseKey(KEY_J)
def RK():
    ReleaseKey(KEY_K)
def RL():
    ReleaseKey(KEY_L)
def RM():
    ReleaseKey(KEY_M)
def RN():
    ReleaseKey(KEY_N)
def RO():
    ReleaseKey(KEY_O)
def RP():
    ReleaseKey(KEY_P)
def RQ():
    ReleaseKey(KEY_Q)
def RR():
    ReleaseKey(KEY_R)
def RS():
    ReleaseKey(KEY_S)
def RT():
    ReleaseKey(KEY_T)
def RU():
    ReleaseKey(KEY_U)
def RV():
    ReleaseKey(KEY_V)
def RW():
    ReleaseKey(KEY_W)
def RX():
    ReleaseKey(KEY_X)
def RY():
    ReleaseKey(KEY_Y)
def RZ():
    ReleaseKey(KEY_Z)
def RCTRL():
    ReleaseKey(VK_CONTROL)
def RSHIFT():
    ReleaseKey(VK_SHIFT)
def RCOLON():
    ReleaseKey(VK_OEM_1)
def RQUOTE():
    ReleaseKey(VK_OEM_7)
def RCOLON():
    ReleaseKey(VK_OEM_1)
def RQUOTE():
    ReleaseKey(VK_OEM_7)
def ROPENBRACKET():
    ReleaseKey(VK_OEM_4)
def RCLOSEBRACKET():
    ReleaseKey(VK_OEM_6)
def RBACKSLASH():
    ReleaseKey(VK_OEM_2)
def RPLUS():
    ReleaseKey(VK_OEM_PLUS)
def RMINUS():
    ReleaseKey(VK_OEM_MINUS)
def R0():
    ReleaseKey(KEY_0)
def R1():
    ReleaseKey(KEY_1)
def R2():
    ReleaseKey(KEY_2)
def R3():
    ReleaseKey(KEY_3)
def R4():
    ReleaseKey(KEY_4)
def R5():
    ReleaseKey(KEY_5)
def R6():
    ReleaseKey(KEY_6)
def R7():
    ReleaseKey(KEY_7)
def R8():
    ReleaseKey(KEY_8)
def R9():
    ReleaseKey(KEY_9)
def RSPACE():
    ReleaseKey(VK_SPACE)
def RENTER():
    ReleaseKey(VK_RETURN)
def RPERIOD():
    ReleaseKey(VK_OEM_PERIOD)
def RCOMMA():
    ReleaseKey(VK_OEM_COMMA)
def RFOREWARDSLASH():
    ReleaseKey(VK_OEM_5)
def RF12():
    ReleaseKey(VK_F12)
##################################



time.sleep(3)
#open console#################################
PCTRL()
PSHIFT()
PJ()
RCTRL()
RSHIFT()
RJ()
#############################################
STRING='javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function E(e){var t=m(e);return t>=w&&t<=b+w}function S(){var e=document.createElement("audio");e.setAttribute("class",l);e.src=i;e.loop=false;e.addEventListener("canplay",function(){setTimeout(function(){x(k)},500);setTimeout(function(){N();p();for(var e=0;e<O.length;e++){T(O[e])}},15500)},true);e.addEventListener("ended",function(){N();h()},true);e.innerHTML=" <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";document.body.appendChild(e);e.play()}function x(e){e.className+=" "+s+" "+o}function T(e){e.className+=" "+s+" "+u[Math.floor(Math.random()*u.length)]}function N(){var e=document.getElementsByClassName(s);var t=new RegExp("\\\\b"+s+"\\\\b");for(var n=0;n<e.length;){e[n].className=e[n].className.replace(t,"")}}var e=30;var t=30;var n=350;var r=350;var i="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";var s="mw-harlem_shake_me";var o="im_first";var u=["im_drunk","im_baked","im_trippin","im_blown"];var a="mw-strobe_light";var f="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";var l="mw_added_css";var b=g();var w=y();var C=document.getElementsByTagName("*");var k=null;for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){if(E(A)){k=A;break}}}if(A===null){console.warn("Could not find a node of the right size. Please try a different page.");return}c();S();var O=[];for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){O.push(A)}}})()'
time.sleep(3)
for letter in STRING:
    #check letters
    if(letter=='a'):
        PA()
        RA()
    if(letter=='A'):
        PSHIFT()
        PA()
        RA()
        RSHIFT()
    if(letter=='b'):
        PB()
        RB()
    if(letter=='B'):
        PSHIFT()
        PB()
        RB()
        RSHIFT()
    if(letter=='c'):
        PC()
        RC()
    if(letter=='C'):
        PSHIFT()
        PC()
        RC()
        RSHIFT()
    if(letter=='d'):
        PD()
        RD()
    if(letter=='D'):
        PSHIFT()
        PD()
        RD()
        RSHIFT()
    if(letter=='e'):
        PE()
        RE()
    if(letter=='E'):
        PSHIFT()
        PE()
        RE()
        RSHIFT()
    if(letter=='f'):
        PF()
        RF()
    if(letter=='F'):
        PSHIFT()
        PF()
        RF()
        RSHIFT()
    if(letter=='g'):
        PG()
        RG()
    if(letter=='G'):
        PSHIFT()
        PG()
        RG()
        RSHIFT()
    if(letter=='h'):
        PH()
        RH()
    if(letter=='H'):
        PSHIFT()
        PH()
        RH()
        RSHIFT()
    if(letter=='i'):
        PI()
        RI()
    if(letter=='I'):
        PSHIFT()
        PI()
        RI()
        RSHIFT()
    if(letter=='j'):
        PJ()
        RJ()
    if(letter=='J'):
        PSHIFT()
        PJ()
        RJ()
        RSHIFT()
    if(letter=='k'):
        PK()
        RK()
    if(letter=='K'):
        PSHIFT()
        PK()
        RK()
        RSHIFT()
    if(letter=='l'):
        PL()
        RL()
    if(letter=='L'):
        PSHIFT()
        PL()
        RL()
        RSHIFT()
    if(letter=='m'):
        PM()
        RM()
    if(letter=='M'):
        PSHIFT()
        PM()
        RM()
        RSHIFT()
    if(letter=='n'):
        PN()
        RN()
    if(letter=='N'):
        PSHIFT()
        PN()
        RN()
        RSHIFT()
    if(letter=='o'):
        PO()
        RO()
    if(letter=='O'):
        PSHIFT()
        PO()
        RO()
        RSHIFT()
    if(letter=='p'):
        PP()
        RP()
    if(letter=='P'):
        PSHIFT()
        PP()
        RP()
        RSHIFT()
    if(letter=='q'):
        PQ()
        RQ()
    if(letter=='Q'):
        PSHIFT()
        PQ()
        RQ()
        RSHIFT()
    if(letter=='r'):
        PR()
        RR()
    if(letter=='R'):
        PSHIFT()
        PR()
        RR()
        RSHIFT()
    if(letter=='s'):
        PS()
        RS()
    if(letter=='S'):
        PSHIFT()
        PS()
        RS()
        RSHIFT()
    if(letter=='t'):
        PT()
        RT()
    if(letter=='T'):
        PSHIFT()
        PT()
        RT()
        RSHIFT()
    if(letter=='u'):
        PU()
        RU()
    if(letter=='U'):
        PSHIFT()
        PU()
        RU()
        RSHIFT()
    if(letter=='v'):
        PV()
        RV()
    if(letter=='V'):
        PSHIFT()
        PV()
        RV()
        RSHIFT()
    if(letter=='w'):
        PW()
        RW()
    if(letter=='W'):
        PSHIFT()
        PW()
        RW()
        RSHIFT()
    if(letter=='x'):
        PX()
        RX()
    if(letter=='X'):
        PSHIFT()
        PX()
        RX()
        RSHIFT()
    if(letter=='y'):
        PY()
        RY()
    if(letter=='Y'):
        PSHIFT()
        PY()
        RY()
        RSHIFT()
    if(letter=='z'):
        PZ()
        RZ()
    if(letter=='Z'):
        PSHIFT()
        PZ()
        RZ()
        RSHIFT()
##################################
#Special Characters###############
    if(letter=='\\'):
       PFOREWARDSLASH()
       RFOREWARDSLASH()
    if(letter=='*'):
        PSHIFT()
        P8()
        R8()
        RSHIFT()
    if(letter==':'):
        PSHIFT()
        PCOLON()
        RCOLON()
        RSHIFT()
    if(letter=='"'):
        PSHIFT()
        PQUOTE()
        RQUOTE()
        RSHIFT()
    if(letter=='('):
        PSHIFT()
        P9()
        R9()
        RSHIFT()
    if(letter==')'):
        PSHIFT()
        P0()
        R0()
        RSHIFT()
    if(letter=='{'):
        PSHIFT()
        POPENBRACKET()
        ROPENBRACKET()
        RSHIFT()
    if(letter=='}'):
        PSHIFT()
        PCLOSEBRACKET()
        RCLOSEBRACKET()
        RSHIFT()
    if(letter=="'"):
        PQUOTE()
        RQUOTE()
    if(letter=='/'):
        PBACKSLASH()
        RBACKSLASH()
    if(letter==';'):
        PCOLON()
        RCOLON()
    if(letter=='='):
        PPLUS()
        RPLUS()
    if(letter=='+'):
        PSHIFT()
        PPLUS()
        RPLUS()
        RSHIFT()
    if(letter=='_'):
        PSHIFT()
        PMINUS()
        RMINUS()
        RSHIFT()
    if(letter=='-'):
        PMINUS()
        RMINUS()
    if(letter=='['):
        POPENBRACKET()
        ROPENBRACKET()
    if(letter==']'):
        PCLOSEBRACKET()
        RCLOSEBRACKET()
    if(letter=='&'):
        PSHIFT()
        P7()
        R7()
        RSHIFT()
    if(letter=='<'):
        PSHIFT()
        PCOMMA()
        RCOMMA()
        RSHIFT()
    if(letter=='>'):
        PSHIFT()
        PPERIOD()
        RPERIOD()
        RSHIFT()
    if(letter=='!'):
        PSHIFT()
        P1()
        R1()
        RSHIFT()
    if(letter==','):
        PCOMMA()
        RCOMMA()
    if(letter=='.'):
        PPERIOD()
        RPERIOD()
#################################
#Numbers#########################
    if(letter=='0'):
        P0()
        R0()
    if(letter=='1'):
        P1()
        R1()
    if(letter=='2'):
        P2()
        R2()
    if(letter=='3'):
        P3()
        R3()
    if(letter=='4'):
        P4()
        R4()
    if(letter=='5'):
        P5()
        R5()
    if(letter=='6'):
        P6()
        R6()
    if(letter=='7'):
        P7()
        R7()
    if(letter=='8'):
        P8()
        R8()
    if(letter=='9'):
        P9()
        R9()
#################################
#Space###########################
    if(letter==' '):
        PSPACE()
        RSPACE()
#################################
#Sumbit##########################
PENTER()
RENTER()
PF12()
RF12()
#################################

Advertisement

Nice! That reminds me of YouTube. <br> <br>Just type &quot;do the harlem shake&quot; in YouTube then press Enter and see what happens.
That's awesome!
very nice job!
THIS IS TOTALLY EPIC. This should be put on reddit.
I don't know what reddit is but if you want to put a link there to this 'ble that would be great to redirect some views here!
Haha, awesome!
Thanks!
This is great!
Thank You!
I like the gif image.
Thanks! It's from Cyanide and Happiness.
Oh no, I thought this harlem stuff was over with :'( <br>Nice i'ble :D
How very clever - I'll bet there's never a dull moment when you're around!
It was only a matter of time. :D
That was better than great. <br /> <br />GM
<p>Great! I made a bookmarklet that runs the code when you click on it, in it works great!!!!! sadly i cannot figure out how to make a link to it...</p>
ahahhahaha LooL
Nice, very cool and i was wondering how you did the automatic favorite and follow?
Did you click the link at the beginning of the instructable?
I would like instructables to stay the way it is. I am just displaying my knowledge and abilities of computer coding and I don't want instructables to turn into a place filled with trickery. If you click on the link at the beginning of the 'ible you'll see that it's all just fun and games, and I've kept it so that you can reverse everything that it does. I am not going to tell anyone how to do it as it would screw up the site.
don't you find that a little un-fair though? <br>
I made sure to keep everything reversible so people can undo any of the actions they want to.
Still, if somebody doesn't read thoroughly and is just skimming...idk its on the borderline..haha but smart idea though <br>
I would suggest to cut the code into a pastebin file instead, instead of poluting the page. (It makes the viewer scroll downa lot)
This is pretty cool. Although....<br><br>You should use pastebin for the code. For sure. <br><br>And when you referenced hsmaker and said this is better because its done from scratch.. That only applies to you. <br><br>Anyway good work! Would've been a hell of a lot simpler just in java though haha.
I wasn't saying that it was better than hsmaker, but it will make you feel more accomplished. Also, it's probably true that java would be easier, maybe using the robot class.
Not wanting to burst your bubble but doesnt hsmaker.com do this already?
Yes, but this will make you feel accomplished as it is done from scratch!

About This Instructable

9,758views

74favorites

License:

Bio: Electrical Engineering Major
More by searx:Sonar Collar for Blind Dogs Dog Mood Detector (Raspberry Pi) Running Videos on a TI84 Calculator 
Add instructable to: