Giter VIP home page Giter VIP logo

jlastfm_widget's Introduction

Intro

After taking a look at http://imagegen.last.fm/basic10/tracks/slicenice.gif a coworker had on his website, I said: “oh I can do better…”.

Since bootstrap is my new go-to thing for web-design (they do a better job than I ever could) I designed the base widget template to use bootstrap components. This could be easily re-factored out.

Goals

  • Drop in solution - input my user-name and bam we got stats. This lead to the next point,
  • No API key usage. All the data is we need is available without needing a api key. The only advantage one would get is json returned data.
  • Bootstrap usage for aesthetically an pleasing look that would fit the rest of my site and allow the widget to be themed

One of the goals of the project was to not use api keys to access data. All the data I needed/wanted was offered in XML and or json format. (sadly not much in json) This fit the goal of having a mostly drop in

usage

Initialization:

fm = new jlastfm("slicenice","#jlastfm");
fm.init();

Include this div, with the selector you passed into the ‘jlastfm’

<div id="jlastfm"></div>

Demo

The demo will not work browsing the file path. (google’s rss → json breaks) for a demo you can do

$ cd jlastfm_widget
$ python -m SimpleHTTPServer

then point your browser to localhost:8000

Reference & sources:

namerepofile/s
jQueryhttps://github.com/jquery/jquery (not sure version)unsure
bootstraphttps://github.com/twbs/bootstrap (version 3?)https://github.com/twbs/bootstrap/tree/master/dist
xml2jsonhttps://github.com/josefvanniekerk/jQuery-xml2jsonhttps://github.com/josefvanniekerk/jQuery-xml2json/blob/master/js/xml2json.js
information on converting rss → json[fn:1]http://stackoverflow.com/questions/670511/convert-rss-to-json

And of course last.fm!


Footnotes

[fn:1] This uses the google ajax service. I had started with this part first (before the xml2json part). The code could most likely be re-factored to use the xml2json stuff removing google from the mix

jlastfm_widget's People

Contributors

jjrh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.