Skip to content

Instantly share code, notes, and snippets.

@fredbradley
Created March 26, 2018 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredbradley/474841df22f926ca9df1e8e47c1933a0 to your computer and use it in GitHub Desktop.
Save fredbradley/474841df22f926ca9df1e8e47c1933a0 to your computer and use it in GitHub Desktop.
function df_tweetEntrant($user) {
// Tweet Entrant
// Follow Entrant
//Sanatize $user
$user = trim($user);
if (strpos($user,'@') !== false) {
$username = $user;
$user = substr($username, 1);
} else {
$username = "@".$user;
}
// (Add entrant to list?)
$hello = array("Hi", "Hello", "Hey", "Hiya", "Howdy", "Aloha", "Hola", "Bonjour", "Heya", "Yo");
$grammar = array(
"Thanks for uploading your demo! Good luck! Tell your friends:",
"Woah! Hot Demo! (we haven't actually heard it yet, this is automated!) Hope you get picked! Share:",
"Boom! Congrats for uploading your demo to our site! Now tell everyone else to do the same:",
"Demo uploaded, oh yeah! Good luck! Tell everyone else to upload theirs at:",
"Demo all received! We hope you get picked out and get some helpful feedback. Share:",
"A-ha! Thanks for uploading your demo. See you in Norwich! Share:",
"If Carlsberg produced demos... they'd likely be a drunk mess! Yours is surely better! Share:"
);
$ga = "utm_source=twitter&utm_medium=onUpload&utm_campaign=tweetEntrant_17&utm_term=".$user."&utm_content=".$user;
$link = "http://www.demofactor.com?".$ga;
$text = doRand($hello)." ".$username."! ".doRand($grammar)." ".$link;
return socialmedia_updateTwitter($text, $username);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment