@php $cfg = app('config')->get('services')['lastfm']; $api_root = app('config')->get('app')['api_root']; $current_track = json_decode(file_get_contents($api_root.'/lastfm/current')); $toptracks = json_decode(file_get_contents($api_root.'/lastfm/top')); $count = 0; @endphp

Last.fm (Profile)

Last/Current Track: {{ $current_track->name }} • {{ $current_track->artist }}

Top {{ $cfg['toptracks'] }} Tracks (Last 7 days)

@foreach ($toptracks as $track) @if ($count >= $cfg['toptracks']) @break @endif {{ str_pad($count+1, 2, '0', STR_PAD_LEFT) }}] {{ $track->name }} • {{ $track->artist }} ({{ $track->plays }} plays)
@php $count++ @endphp @endforeach