This plugin retrieves the last played song from your Last.FM account.
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.
- Upload to your plugins folder, usually `wp-content/plugins/`.
- Activate the plugin on the plugin screen.
- A new tab should appear at the plugin screen. Inform your last.fm username and press the "Update" button.
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.
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; ?>
Just leave me a comment. ;)