WP-Last.FM

14/11/06

This plugin retrieves the last played song from your Last.FM account.

DOWNLOAD: wp-lastfm.zip

What do I need to use this plugin?

You need to create an account at Last.FM and configure your player to send all tracks you're listening to Last.FM. Check it out the Last.FM website for more details.

This plugin uses the CURL library. If your server doesn't have this library, WP-Last.FM plugin tries to get the info by using the "fopen" function automatically.

Installing

  1. Upload to your plugins folder, usually `wp-content/plugins/`.
  2. Activate the plugin on the plugin screen.

    Plugin activation
  3. A new tab should appear at the plugin screen. Inform your last.fm username and press the "Update" button.

    Plugin configuration

Using the plugin

After saving a post, a "custom field" will be saved containing the last played song. If you have no songs in your recent tracklist, this field won't be added.

Admin: Custom Field

Showing the track info

Just add the following code in your template:

<?php if ($track = get_post_meta($id, 'listening_to', true)): ?>
    <p class="listening-to"><strong>Listening to:</strong> <?php echo $track; ?></p>
<? endif; ?>

Reporting bugs

Just leave me a comment. ;)

Donate

Last.fm no Wordpress

14/11/06

Acabei de fazer um plugin que busca a última música que você ouviu no Last.fm. Se você quiser instalá-lo, baixe o arquivo e coloque-o na sua pasta de plugins.

Para ativá-lo, acesse a aba Plugins do admin e clique na opção Activate.

Ativar plugin

Uma nova aba será adicionada na seção de Plugins. Vá até lá e defina seu usuário. Você também pode definir se a música será atualizada sempre que você salvar o post. Se não marcar esta opção ela será inserida apenas quando você publica-lo.

Configurações do plugin

Após salvar cada post, um "custom field" será criado com a última música que você ouviu. Caso não exista nenhuma faixa na sua relação de músicas recentes, este campo não será preenchido.

Admin: Custom Field

Para adicionar a informação em cada post, adicione o seguinte código.

<?php if ($track = get_post_meta($id, 'listening_to', true)): ?>
    <p class="listening-to"><strong>Ouvindo:</strong> <?php echo $track; ?></p>
<? endif; ?>

Este plugin tenta buscar as informações usando a biblioteca CURL, já que na Dreamhost, por medidas de segurança, não é possível acessar arquivos externos usando a função fopen. De qualquer modo, caso a biblioteca não seja detectada, o plugin usará automaticamente a fopen.

Se você encontrar qualquer problema, poste um comentário.