Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,70 +35,70 @@ 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 <https://addons.mozilla.org/en-US/firefox/addon/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)
-----------------

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": "<django.db.models.base.ModelState object at 0x1019b2910>",
"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": "<django.db.models.base.ModelState object at 0x1019b2910>",
"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": "<django.db.models.base.ModelState object at 0x1019b2c90>",
"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": "<django.db.models.base.ModelState object at 0x1019b2c90>",
"to_phone": "",
"from_email": "nate@valentun.es",
"recipient_name": "",
"from_phone": "",
"id": 3

If you want to delete the record, type this command::
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions vt/static/button/Main.as
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 14 additions & 14 deletions vt/static/button/com/zuardi/musicplayer/MusicButton.as
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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))
}
}
}
Expand Down Expand Up @@ -284,7 +284,7 @@ class com.zuardi.musicplayer.MusicButton extends MovieClip
_playlist.loadXSPFPlaylist(playlist_url)
}
}

function playTrack(){
alert("play track ")
_last_position = -1;
Expand Down Expand Up @@ -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"){
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
}
}
14 changes: 7 additions & 7 deletions vt/static/button/com/zuardi/musicplayer/MusicPlayer.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -62,7 +62,7 @@ class com.zuardi.musicplayer.MusicPlayer extends MovieClip
//</workaround>
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
Expand Down Expand Up @@ -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)
}

}
10 changes: 5 additions & 5 deletions vt/static/button/com/zuardi/musicplayer/Playlist.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}

}
6 changes: 3 additions & 3 deletions vt/static/button/com/zuardi/musicplayer/ProgressiveSlider.as
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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);
}

}
Loading