Skip to content

Instantly share code, notes, and snippets.

View dgw's full-sized avatar

dgw dgw

View GitHub Profile
@dgw
dgw / lastfm.php
Last active August 29, 2015 14:02 — forked from dewey/lastfm.php
Forked from dewey and changed to display "last listened to" if the latest track in the feed is not currently playing.
#!/usr/bin/php
<?php
$doc = new DOMDocument();
$doc->load("http://ws.audioscrobbler.com/2.0/user/voyagerfan5761/recenttracks.xml?limit=1");
$arrFeeds = array();
foreach ($doc->getElementsByTagName('track') as $node) {
$itemRSS = array (
'artist' => $node->getElementsByTagName('artist')->item(0)->nodeValue,
'name' => $node->getElementsByTagName('name')->item(0)->nodeValue,
'nowplaying' => ($node->attributes->getNamedItem('nowplaying')) ? true : false
@dgw
dgw / 01_README.md
Last active January 19, 2022 03:09 — forked from HumorBaby/01_README.md
Test script to stress-test sopel-irc/sopel-github#26;

Change as needed:

  • TEST_URL: set to local or remote test server
  • REAL_WEBHOOK_SECRET: match secret set in Sopel configuration
  • PAYLOAD: example has minimal payload required to be processed by the current sopel-github module (be68263d4aa4ddd6cb790e4e228b9894a3aaace0)
  • NUM_PROCS: number of simulateous processes to send requests
  • NUM_REQUESTS: total number of requests to send
  • RANDOM_SEED: change the distribution of valid/invalid requests by updating the starting random seed

Results:

  • . indicates a valid request sent