Finding your most popular Tweets


The Twitter logo drawn in circles.

Twitter's search interface has all sorts of lovely and obscure options. My three favourites are "min_retweets:", "min_replies:", and "min_faves:" Using those filters, you can create a search for Tweets which meet a certain threshold. For example, here are my Tweets which have been liked more than 500 times: twitter.com/search?q=from:edent min_faves:500 Here are the ones which have been retweeted 300 times with at least 100 replies: twitter.com/search?q=from%:edent min_replies:100…

Continue reading →

Remove the first few lines from a string in PHP


Binary code displayed on a screen.

Problem: I have a multiline string - not a file - and I want to remove the first few lines from it and keep the rest. I found this surprisingly unintuitive. So these are notes in case I want to do it again. Feel free to suggest a better way! Example Given this input: $str = "Once upon\nA Time\nLived a big\nDragon\nCalled Cuthbert."; I want the output to be: "Dragon\nCalled Cuthbert." That is, remove the first X lines in a string. Exploding kittens Using explode()…

Continue reading →