diff --git a/README.rst b/README.rst index 5797a50..f74a38d 100644 --- a/README.rst +++ b/README.rst @@ -12,8 +12,8 @@ Valentunes components - Interests - Intro note - Your email -2) Get suggested tracks - - from Musixmatch +2) Get suggested tracks + - from Musixmatch - and/or from Hunch (based on your sweetheart's Twitter / Facebook ID) 3) From this list of tracks, display filtered playlist using Echonest API - by genre @@ -35,36 +35,36 @@ You must install the components using pip:: $ source bin/activate $ easy_install pip $ pip install -r requirements.txt - + Now you can start up Django with:: $ cd vt $ ./manage.py runserver - + Testing with Poster ------------------- -Download +Download `Poster `_ this Firefox plugin. And then pass a POST using the following as the content:: { - "interests": "Hello", - "to_email": "", - "from_name": "Anna", - "intro_note": "", - "to_phone": "", - "from_email": "", - "recipient_name": "Nate", + "interests": "Hello", + "to_email": "", + "from_name": "Anna", + "intro_note": "", + "to_phone": "", + "from_email": "", + "recipient_name": "Nate", "from_phone": "" } - + Make sure that you set the Content-type to ``application/json`` The response should return the URL to the new object that was just created. i.e.:: http://localhost:8000/api/card/10/ - + Testing with curl (don't use - this is deprecated) ----------------- @@ -72,33 +72,33 @@ To add a new card via the API, type this command in the terminal:: $ curl localhost:8000/api/card/ -F "from_name=Nate" -F "from_email=nate@valentun.es" { - "interests": "", - "to_email": "", - "from_name": "Josh", - "create_date": "2011-02-12 18:25:45", - "intro_note": "", - "_state": "", - "to_phone": "", - "from_email": "nate@valentun.es", - "recipient_name": "", - "from_phone": "", + "interests": "", + "to_email": "", + "from_name": "Josh", + "create_date": "2011-02-12 18:25:45", + "intro_note": "", + "_state": "", + "to_phone": "", + "from_email": "nate@valentun.es", + "recipient_name": "", + "from_phone": "", "id": 3 } - + Now fetch that record you just created:: $ curl localhost:8000/api/3/ { - "interests": "", - "to_email": "", - "from_name": "Nate", - "create_date": "2011-02-12 18:25:45", - "intro_note": "", - "_state": "", - "to_phone": "", - "from_email": "nate@valentun.es", - "recipient_name": "", - "from_phone": "", + "interests": "", + "to_email": "", + "from_name": "Nate", + "create_date": "2011-02-12 18:25:45", + "intro_note": "", + "_state": "", + "to_phone": "", + "from_email": "nate@valentun.es", + "recipient_name": "", + "from_phone": "", "id": 3 If you want to delete the record, type this command:: diff --git a/requirements.txt b/requirements.txt index f36c50f..a2e3b93 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,4 +23,4 @@ django-debug-toolbar #django-piston #-e git+git://github.com/mozilla/django-piston.git#egg=django-piston # there is a python-musicbrainz3 but it hasn't been released on PyPi yet, so we'll stick with v2 -python-musicbrainz2 +python-musicbrainz2 diff --git a/vt/static/button/Main.as b/vt/static/button/Main.as index f8d21b1..f564765 100644 --- a/vt/static/button/Main.as +++ b/vt/static/button/Main.as @@ -39,14 +39,14 @@ class Main extends MovieClip{ button_properties.b_load_color = bcolors_ar[0] button_properties.b_play_color = bcolors_ar[1] button_properties.b_stop_color = bcolors_ar[2] - button_properties.b_error_color = bcolors_ar[3] + button_properties.b_error_color = bcolors_ar[3] } if(_root.buttons!=undefined){ var buttons_ar:Array = _root.buttons.split(",") button_properties.b_load = buttons_ar[0] button_properties.b_play = buttons_ar[1] button_properties.b_stop = buttons_ar[2] - button_properties.b_error = buttons_ar[3] + button_properties.b_error = buttons_ar[3] } Stage.scaleMode = "noscale" Stage.align = "LT" diff --git a/vt/static/button/com/zuardi/musicplayer/MusicButton.as b/vt/static/button/com/zuardi/musicplayer/MusicButton.as index c5f5765..198dd60 100644 --- a/vt/static/button/com/zuardi/musicplayer/MusicButton.as +++ b/vt/static/button/com/zuardi/musicplayer/MusicButton.as @@ -50,7 +50,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip var song_title:String; var menu:ContextMenu; //- - + //default values private var DEFAULT_SKIN_LOAD_TIMEOUT = 10; //seconds private var DEFAULT_SONG_LOAD_TIMEOUT = 30; //seconds @@ -71,7 +71,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip */ //- private var music_player: MusicPlayer; //0 - + //private vars private var _skin_timeout_error:Boolean; private var _last_position:Number; @@ -101,13 +101,13 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip first_track = 0; }else{ first_track -= 1; - } + } if(!skin_load_timeout) skin_load_timeout = DEFAULT_SKIN_LOAD_TIMEOUT; if(!song_load_timeout) song_load_timeout = DEFAULT_SONG_LOAD_TIMEOUT; alert("song_url="+song_url) _skin_timeout_error = false; loadDefaultSkin(); - + //#Flash7 //+ //customized menu @@ -162,10 +162,10 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip open_menu_btn["owner"] = this; open_menu_btn.onPress = openMenuPressed; open_menu_btn.onRollOver = openMenuOver; -*/ +*/ //- setColors() - loadPlaylist() + loadPlaylist() } //#FoldMenu @@ -190,7 +190,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip } */ //- - + function setColors(){ alert("setColors()") var buttons_ar = [load_skin_mc,play_skin_mc,stop_skin_mc,error_skin_mc] @@ -209,7 +209,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip }else{ if(b_fgcolor.length>0){ var bcolor = new Color(buttons_ar[i]) - bcolor.setRGB(Number("0x"+b_fgcolor)) + bcolor.setRGB(Number("0x"+b_fgcolor)) } } } @@ -284,7 +284,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip _playlist.loadXSPFPlaylist(playlist_url) } } - + function playTrack(){ alert("play track ") _last_position = -1; @@ -334,7 +334,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip //- playTrack(); }else{ - alert("fim") + alert("fim") if(repeat.toString()=="true"){ _playlist.current_track = 0; if(shuffle.toString()=="true"){ @@ -418,7 +418,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip if (remaining > 20000){ //nada }else { - _root.teste_mc.play(); + _root.teste_mc.play(); } stopTrack(); } @@ -461,7 +461,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip } _last_position = music_player.music_position; } - + function loadDefaultSkin(){ //default background this.attachMovie("default_b_bg","bg_skin_mc",2) @@ -518,7 +518,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip isloadloaded = true; } alert("a"+isloadloaded+" "+load_skin_mc.getBytesLoaded()) - + if((play_skin_mc.getBytesLoaded()>0)&&((play_skin_mc.getBytesLoaded()/play_skin_mc.getBytesTotal())==1)){ isplayloaded = true; play_skin_mc._visible = false; @@ -552,6 +552,6 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip } //FOR DEBUG function alert(p_msg){ - trace("#my trace# "+p_msg) + trace("#my trace# "+p_msg) } } \ No newline at end of file diff --git a/vt/static/button/com/zuardi/musicplayer/MusicPlayer.as b/vt/static/button/com/zuardi/musicplayer/MusicPlayer.as index 923b949..5644d35 100644 --- a/vt/static/button/com/zuardi/musicplayer/MusicPlayer.as +++ b/vt/static/button/com/zuardi/musicplayer/MusicPlayer.as @@ -12,11 +12,11 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */ class com.zuardi.musicplayer.MusicPlayer extends MovieClip { - + //interface var onMusicLoaded:Function; var onMusicEnd:Function; - + private var _main_sound:Sound; private var _sound_container_mc:MovieClip;//0; @@ -27,7 +27,7 @@ class com.zuardi.musicplayer.MusicPlayer extends MovieClip } //public methods - + //loads a mp3 sound, call onMusicLoaded(success) when finish the download or when an error occurs function loadMusic(p_music_url:String,p_buffer:Boolean) { @@ -62,7 +62,7 @@ class com.zuardi.musicplayer.MusicPlayer extends MovieClip // this["owner"].onMusicEnd() } - _main_sound.loadSound(p_music_url,p_buffer); + _main_sound.loadSound(p_music_url,p_buffer); } //start playing the music, calls onMusicEnd when the music reaches the end @@ -110,9 +110,9 @@ class com.zuardi.musicplayer.MusicPlayer extends MovieClip { return _main_sound.duration; } - + function alert(p_msg){ - trace(p_msg) + trace(p_msg) } - + } \ No newline at end of file diff --git a/vt/static/button/com/zuardi/musicplayer/Playlist.as b/vt/static/button/com/zuardi/musicplayer/Playlist.as index cb58916..a0ffbd7 100644 --- a/vt/static/button/com/zuardi/musicplayer/Playlist.as +++ b/vt/static/button/com/zuardi/musicplayer/Playlist.as @@ -12,7 +12,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */ class com.zuardi.musicplayer.Playlist{ - + //public vars var tracks:Array; var playlist_size:Number; @@ -21,11 +21,11 @@ class com.zuardi.musicplayer.Playlist{ var play_order_table:Array; //interface var onPlaylistLoaded:Function; - + //private vars private var _xspf:XML; private var _delay_interval:Object; - + //constructor function Playlist(Void) { @@ -88,7 +88,7 @@ class com.zuardi.musicplayer.Playlist{ trace("single mode = "+p_url) _xspf.parseXML(p_url); //half second delay - _delay_interval = setInterval(function(p_xspf,p_target){ + _delay_interval = setInterval(function(p_xspf,p_target){ trace("DELAY") p_xspf.onLoad(true); clearInterval(p_target._delay_interval) @@ -121,7 +121,7 @@ class com.zuardi.musicplayer.Playlist{ trace("normalOrderTable() play_order_table[0]"+play_order_table[0]) } function alert(p_msg){ - trace(p_msg) + trace(p_msg) } } \ No newline at end of file diff --git a/vt/static/button/com/zuardi/musicplayer/ProgressiveSlider.as b/vt/static/button/com/zuardi/musicplayer/ProgressiveSlider.as index a9e4f37..21b9cb2 100644 --- a/vt/static/button/com/zuardi/musicplayer/ProgressiveSlider.as +++ b/vt/static/button/com/zuardi/musicplayer/ProgressiveSlider.as @@ -45,7 +45,7 @@ class com.zuardi.musicplayer.ProgressiveSlider extends MovieClip var percent = (this._xmouse/this._width)*100 level = percent; } - + function set off_color(p_color:String){ var bg_color = new Color(bg_mc) bg_color.setRGB(Number("0x"+p_color)) @@ -57,10 +57,10 @@ class com.zuardi.musicplayer.ProgressiveSlider extends MovieClip function set level(p_percent:Number){ if(p_percent>100)p_percent=100; if(p_percent<0)p_percent=0; - level_bar_mc._xscale = p_percent + level_bar_mc._xscale = p_percent var eventObj:Object={target:this,type:"change"} eventObj.level = p_percent; dispatchEvent(eventObj); } - + } \ No newline at end of file diff --git a/vt/static/css/style.css b/vt/static/css/style.css index 2e416cd..724efa8 100644 --- a/vt/static/css/style.css +++ b/vt/static/css/style.css @@ -37,7 +37,7 @@ input.btn { border-color: Black; } .even { - + -moz-box-shadow: inset 0px 0px 14px #FC9D9A; /* FF3.5+ */ -webkit-box-shadow: inset 0px 0px 14px #FC9D9A; /* Saf3.0+, Chrome */ box-shadow: inset 0px 0px 14px #FC9D9A; /* Opera 10.5, IE9 */ @@ -58,18 +58,18 @@ display:inline; -moz-box-shadow: inset 0px 0px 14px #FE4365; /* FF3.5+ */ -webkit-box-shadow: inset 0px 0px 14px #FE4365; /* Saf3.0+, Chrome */ box-shadow: inset 0px 0px 14px #FE4365; /* Opera 10.5, IE9 */ - + -moz-border-radius: 14px; /* FF1+ */ -webkit-border-radius: 14px; /* Saf3-4 */ border-radius: 14px; /* Opera 10.5, IE9, Saf5, Chrome */ padding:10px; } .player { - + -moz-box-shadow: 0px 0px 6px #FFF; /* FF3.5+ */ -webkit-box-shadow: 0px 0px 6px #FFF; /* Saf3.0+, Chrome */ box-shadow: 0px 0px 6px #fff; /* Opera 10.5, IE9 */ - + -moz-border-radius: 4px; /* FF1+ */ -webkit-border-radius: 4px; /* Saf3-4 */ border-radius: 4px; /* Opera 10.5, IE9, Saf5, Chrome */ @@ -124,9 +124,9 @@ label:after { content: ":" } font-size:16px; text-indent:10px; } - + img { border-style: none; } - + @font-face { font-family: 'MyUnderwoodRegular'; src: url('../fonts/MyUnderwood-webfont.eot'); @@ -134,14 +134,14 @@ label:after { content: ":" } font-weight: normal; font-style: normal; } - + @font-face { font-family: 'CutiePop'; src: local('☺'), url('../fonts/CutiePop.ttf') format('truetype'); font-weight: normal; font-style: normal; } - + @font-face { font-family: 'Impact_Label'; src: local('☺'), url('../fonts/Impact_Label.ttf') format('truetype'); diff --git a/vt/valentunes/templates/_footer.html b/vt/valentunes/templates/_footer.html index 6dea41b..8eab600 100644 --- a/vt/valentunes/templates/_footer.html +++ b/vt/valentunes/templates/_footer.html @@ -1,6 +1,6 @@

About Valentun.es

-Made with Twilio, MusixMatch and Skreemr +Made with Twilio, MusixMatch and Skreemr

Hosted by DjangoZoom

\ No newline at end of file diff --git a/vt/valentunes/templates/about.html b/vt/valentunes/templates/about.html index e84fb44..f981873 100644 --- a/vt/valentunes/templates/about.html +++ b/vt/valentunes/templates/about.html @@ -2,13 +2,13 @@ {% block content %}

What is Valentun.es?

-

It starts with a missed Valentine card and ends with a not-so-lovely apology. We wanted to make it insanely easy to craft a playlist that will make your Valentine swoon. +

It starts with a missed Valentine card and ends with a not-so-lovely apology. We wanted to make it insanely easy to craft a playlist that will make your Valentine swoon. Valentun.es lets you enter your Valentine’s name and his or her specific interests. It then searches lyrics to discover music that uses those words and then serves up streaming tracks so you can listen and hand-pick the final playlist. Valentun.es then delivers the playlist to their cellphone.

What better way to say "Be my Valentine!" than through a tinny cellphone speaker via AT&T. If your special someone can listen all the way through 5 songs without dropping, you know s/he's a keeper!

The iPhone app lets you be even more forgetful, so you can quickly create a Valentune on-the-go (presumably while shopping for flowers 5 minutes before making dinner reservations). Just like the web front end, the app lets you enter your Valentine's info, view and listen to possible tracks, and select the ones you want to package as a playlist.

How was Valentun.es built?

-Valentun.es was built in 24 hrs by a team of music hackers as part of Music Hack Day NYC. +Valentun.es was built in 24 hrs by a team of music hackers as part of Music Hack Day NYC. Here are some of the APIs, SDKs and tools that we used:
    @@ -38,7 +38,7 @@

    What's next?

    We have lots of ideas for how to make Valentun.es even better such as using Echonest to filter the songs by danceability and other taste factors, or look up your Valentine's musical preferences on Last.fm to filter the list even further.

    We'd also like to make the valentune available as a webpage at a unique URL that you can email to your sweetheart, rather than just listening through the cell phone.

    What things would you like to see? Let us know your ideas by using the Feedback widget on the right side of the screen.

    - +

    Like Valentun.es?

    -Follow us on Twitter +Follow us on Twitter {% endblock %} \ No newline at end of file diff --git a/vt/valentunes/templates/base.html b/vt/valentunes/templates/base.html index 98cc1ef..8a06a89 100644 --- a/vt/valentunes/templates/base.html +++ b/vt/valentunes/templates/base.html @@ -6,7 +6,7 @@ {%block head %}{% endblock %} @@ -26,7 +26,7 @@ {% trans "Log in" %} {% endif %}
    - + {% block header %}

    create a customized playlist of music your valentine will love...

    {% endblock %} diff --git a/vt/valentunes/templates/choose.html b/vt/valentunes/templates/choose.html index 27d0448..396b422 100644 --- a/vt/valentunes/templates/choose.html +++ b/vt/valentunes/templates/choose.html @@ -17,7 +17,7 @@
    'search term "{{ track.search_term }}"
    - + {% endfor %}
diff --git a/vt/valentunes/templates/gift.html b/vt/valentunes/templates/gift.html index b27770a..fdd35f2 100644 --- a/vt/valentunes/templates/gift.html +++ b/vt/valentunes/templates/gift.html @@ -5,7 +5,7 @@ {% block content %} - + - -
+ +
Dearest {{ card.recipient_name }},

You've just received a ValenTUNE from {{ card.from_name }}! Your bespoke playlist has been carefully crafted out of the most equisite music on the web and hand selected by your special someone. It was then gently gift-wrapped, delicately placed into this webpage and delivered on the backs of sea turtles to arrive on this screen. {{ card.from_name }} must really adore you!

Oooh look - there's a note: