Click here to Skip to main content
15,867,771 members
Articles / Programming Languages / Javascript
Tip/Trick

A Very High-Level Outline for a Way Cool Utility

Rate me:
Please Sign up or sign in to vote.
4.38/5 (15 votes)
24 Nov 2014CPOL2 min read 39.8K   11   18
In which the author takes the "That is an Exercise Left to the Reader" cop-out to Extremes

What Nerve That Guy Has!

This may be the strangest article you'll ever read on CodeProject - instead of showing you how to accomplish something in code, it instead outlines the steps necessary to create what I think would be a hip/fab/groovy/cool utility, leaving the actual writing of the code to whoever wants to tackle it - I'm taking "armchair coding" to a "whole 'nother level" with this.

Here's the idea: From a list of names (they have to be people who are famous enough to have a Wikipedia page), extract the person's birthplace and, if they are an athlete, the position they play. If they are a musician, the instrument they play. Assemble this information into the necessary code to generate a map displaying a marker on each person's birthtown, along with information that will display when the marker is selected (clicked or touched). The information would be their name, the name of their birthtown, and the position/instrument they play).

Simple, right? Here it is in a skeletal outline:

  • Assemble the names
  • "Wikipidify" the names
  • Extract the birthplace and position or instrument of each subject from their wikipedia article
  • Generate a map with markers for each birthplace

And now with a little more detail/implementation suggestions/clues

Assemble the names (for example, from a site like this one use HTML Agility Pack to parse the contents

Wikipedify the names (see my tip here for a method to do that

Extract the birthplace and position or instrument from their wikipedia article (use HTML Agility Pack for this, too)

Generate a map with markers for each birthplace using a combination of HTML, CSS, and jQuery and the gomap jQuery plugin (see my tip here or the one it references here)

As an idea of what the utility could generate, here's a scream shot of a map of the USA showing markers for the birthplaces of the various members of the Eagles, with one marker selected:

Image 1

You can czech out a web site with various collections of markers here

Okay, I'll at Least Give You a Little Pseudocode

Some very rudimentary pseudocode might be:

C#
public Class athleteInfo { String name, String birthplace, string position }
public Class musicianInfo { String name, String birthplace, string instrument }

List<string> names = GetNamesFromSite("http://...");
List<string>wikipediaURLs = GenerateWikiURLSFromNames(names);
Collection<playerinfo> playerData = GetPlayerData(wikipediaURLs);
</playerinfo></string></string>

...and for the jQuery to generate to insert into the HTML file, something like this:

Java
$.goMap.createMarker({
address: 'Chico, CA',
title: 'Aaron Rodgers',
html: '<h1>Aaron Rodgers</h1><h2>Chico, California</h2><p>December 2, 1983</p>'
});

Note: the goMap jQuery plugin is available here

The Greatest Thing Since Sliced Breadfruit of the Loom

With this utility, a user could (theoretically, anyway) simply provide the URL for a website that contains a list of names, and the HTML map file would be generated in 3.14 shakes of a lamb's tail (AKA "Shepherd's Pi"). It would take a little longer than that to write the utility, of course, but after 10 gazillion people used the utility, it would make the expended time seem a mere pittance in comparison.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Across Time & Space
United States United States
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

Comments and Discussions

 
QuestionWhy you should not write a CodeProject article while drunk... Pin
Wing Flanagan25-Nov-14 8:56
Wing Flanagan25-Nov-14 8:56 
SuggestionRe: Why you should not write a CodeProject article while drunk... Pin
jediYL30-Nov-14 12:03
professionaljediYL30-Nov-14 12:03 
QuestionWhy not create a GitHub project so everybody can contribute ? Pin
fredatcodeproject25-Nov-14 1:42
professionalfredatcodeproject25-Nov-14 1:42 
AnswerRe: Why not create a GitHub project so everybody can contribute ? Pin
B. Clay Shannon25-Nov-14 3:18
professionalB. Clay Shannon25-Nov-14 3:18 
GeneralRe: Why not create a GitHub project so everybody can contribute ? Pin
fredatcodeproject25-Nov-14 22:10
professionalfredatcodeproject25-Nov-14 22:10 
GeneralMy vote of 3 Pin
BillWoodruff24-Nov-14 12:49
professionalBillWoodruff24-Nov-14 12:49 
QuestionEagles... Pin
Ravi Bhavnani24-Nov-14 7:23
professionalRavi Bhavnani24-Nov-14 7:23 
GeneralInteresting to think about Pin
Member 1096435411-Aug-14 10:44
Member 1096435411-Aug-14 10:44 
GeneralRe: Interesting to think about Pin
B. Clay Shannon11-Aug-14 10:57
professionalB. Clay Shannon11-Aug-14 10:57 
GeneralMy vote of 3 Pin
newton.saber10-Aug-14 6:07
newton.saber10-Aug-14 6:07 
GeneralInteresting thoughts! Pin
Douglas Hill9-Aug-14 11:39
Douglas Hill9-Aug-14 11:39 
GeneralRe: Interesting thoughts! Pin
B. Clay Shannon9-Aug-14 15:07
professionalB. Clay Shannon9-Aug-14 15:07 
GeneralRe: Interesting thoughts! Pin
Douglas Hill9-Aug-14 19:36
Douglas Hill9-Aug-14 19:36 
GeneralRe: Interesting thoughts! Pin
B. Clay Shannon10-Aug-14 4:02
professionalB. Clay Shannon10-Aug-14 4:02 
GeneralMy vote of 1 Pin
Assorted Trailmix9-Aug-14 1:00
Assorted Trailmix9-Aug-14 1:00 
GeneralMy vote of 5 Pin
Volynsky Alex8-Aug-14 21:52
professionalVolynsky Alex8-Aug-14 21:52 
GeneralMy vote of 1 Pin
Member 104250068-Aug-14 8:10
Member 104250068-Aug-14 8:10 
GeneralRe: My vote of 1 Pin
B. Clay Shannon8-Aug-14 8:16
professionalB. Clay Shannon8-Aug-14 8:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.