The Eagles Have Landed
If you have a list of names of famous people such as this:
- Glenn Frey
- Don Henley
- Bernie Leadon
- Randy Meisner
- Joe Walsh
- Timothy B. Schmit
- Don Felder
- Jackon Browne
- J.D. Souther
...you may want to linkify the names to point to their respective wikipedia articles. To do so is not difficult, because wikipedia follows a standard format for the URLs for its entries - in most cases for proper names, it simply replaces the space between the first and last name with an underscore, like so: "Chris Hillman" becomes "Chris_Hillman". The link for the Byrdman of Bakersfield (poetic license) is: href="http://en.wikipedia.org/wiki/Chris_Hillman"
There's always an exception, though (there may be an exception to that rule, too, which would be nice). In this case, though, there's not an exception to the exception rule (oh, pooh!), so we have to watch out for "special cases" such as names with initials. In this case, wikipedia retains the period but places an underscore after it, such as: http://en.wikipedia.org/wiki/A._A._Milne
Still, programatically transforming names into the accepted format is pretty easy. Here's some example code; you can pass the name of any person with a wikipedia page to the Wikipidify() method to get back the appropriate HTML for the link to that wikipedia page.
The sample code uses names of current and former members of The Eagles (the Eagles from Southern California, not the Philadelphia Eagles, football fans), along with the names of some affiliated/associated people, such as "The Fifth Eagle," Jackson Browne, as well as songwriter J.D. Souther. A fictional character, Rupert Pupkin (The King of Comedy ) is also included to show what happens when a person in the list does not have a wikipedia page (the link is created fine, but clicking it takes you to a "Winchester Mystery page").
private void buttonYourLip_Click(object sender, EventArgs args)
{
List<string> eaglets = new List<string>();
eaglets.Add("Glenn Frey");
eaglets.Add("Don Henley");
eaglets.Add("Bernie Leadon");
eaglets.Add("Randy Meisner");
eaglets.Add("Joe Walsh");
eaglets.Add("Timothy B. Schmit");
eaglets.Add("Don Felder");
eaglets.Add("Jackon Browne");
eaglets.Add("J.D. Souther");
eaglets.Add("Rupert Pupkin");
List<string> htmlifiedEaglets = new List<string>();
foreach (var eaglet in eaglets)
{
htmlifiedEaglets.Add(Wikipidify(eaglet));
}
System.IO.File.WriteAllLines(@"C:\alreadyGone\eaglets.txt", htmlifiedEaglets);
}
private string Wikipidify(string eaglet)
{
const String wikipediaTemplate = "<a href=\"http://en.wikipedia.org/wiki/{0}\" target=\"_blank\">{1}</a>";
string HTMLifiedEaglet = String.Empty;
string underlinedEaglet = String.Empty;
underlinedEaglet = eaglet.Replace(".", ". ");
underlinedEaglet = underlinedEaglet.Replace(" ", " ");
underlinedEaglet = underlinedEaglet.Replace(" ", "_");
HTMLifiedEaglet = String.Format(wikipediaTemplate, underlinedEaglet, eaglet);
return HTMLifiedEaglet;
}
</string></string></string></string>
As you can see, the results are saved to a file. The file created for the list shown above looks like this:
<a href="http://en.wikipedia.org/wiki/Glenn_Frey" target="_blank">Glenn Frey</a> <a href="http://en.wikipedia.org/wiki/Don_Henley" target="_blank">Don Henley</a> <a href="http://en.wikipedia.org/wiki/Bernie_Leadon" target="_blank">Bernie Leadon</a> <a href="http://en.wikipedia.org/wiki/Randy_Meisner" target="_blank">Randy Meisner</a> <a href="http://en.wikipedia.org/wiki/Joe_Walsh" target="_blank">Joe Walsh</a> <a href="http://en.wikipedia.org/wiki/Timothy_B._Schmit" target="_blank">Timothy B. Schmit</a> <a href="http://en.wikipedia.org/wiki/Don_Felder" target="_blank">Don Felder</a> <a href="http://en.wikipedia.org/wiki/Jackson_Browne" target="_blank">Jackson Browne</a> <a href="http://en.wikipedia.org/wiki/J._D._Souther" target="_blank">J.D. Souther</a> <a href="http://en.wikipedia.org/wiki/Rupert_Pupkin" target="_blank">Rupert Pupkin</a>
If you don't want to take the time to add this code to a project just now, you can see the list of these generated links here
Outro
As you might surmise, I am a big fan of the Eagles; I bought their debut (eponymous) LP when it was still warm to the touch - in my birthplace of Fort Bragg, California. Although nobody asked me, I feel their best album - a masterpiece! - is the concept album "Desperado" (it also has the best back cover photo of all time).
Fade Out
I like almost everything the Eagles ever did, through all their personnel changes, with one blatant and glaring exception: "The Best of My Love" is one of the lamest songs I've ever heard, vying with the Commodore's "Three Times a Lady" for the most gag-worthy song of all time from otherwise good-great bands. If you agree with me that they sound like they've been hypnotized by Barry Manilow on that tune, go to your window, open it, lean out and shout at the tip-top of your voice: "I'm fed up, and I'm not gonna take it any more! No more plodding, saccharine love songs by people who can do so much better!!!"
Not Fade Away
You can purchase any of the Eagles albums from here
I am in the process of morphing from a software developer into a portrayer of Mark Twain. My monologue (or one-man play, entitled "The Adventures of Mark Twain: As Told By Himself" and set in 1896) features Twain giving an overview of his life up till then. The performance includes the relating of interesting experiences and humorous anecdotes from Twain's boyhood and youth, his time as a riverboat pilot, his wild and woolly adventures in the Territory of Nevada and California, and experiences as a writer and world traveler, including recollections of meetings with many of the famous and powerful of the 19th century - royalty, business magnates, fellow authors, as well as intimate glimpses into his home life (his parents, siblings, wife, and children).
Peripatetic and picaresque, I have lived in eight states; specifically, besides my native California (where I was born and where I now again reside) in chronological order: New York, Montana, Alaska, Oklahoma, Wisconsin, Idaho, and Missouri.
I am also a writer of both fiction (for which I use a nom de plume, "Blackbird Crow Raven", as a nod to my Native American heritage - I am "½ Cowboy, ½ Indian") and nonfiction, including a two-volume social and cultural history of the U.S. which covers important events from 1620-2006: http://www.lulu.com/spotlight/blackbirdcraven