Click here to Skip to main content
11,720,321 members (81,272 online)
Click here to Skip to main content

A Very High-Level Outline for a Way Cool Utility

, 24 Nov 2014 CPOL 17.6K 11
Rate this:
Please Sign up or sign in to vote.
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:

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:

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>

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

$.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)

Share

About the Author

B. Clay Shannon
Founder "Across Time & Space"
United States United States
Ideaman and Coder at Across Time & Space, creator of "Mark Twain Central" at http://twaincentral.azurewebsites.net/

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: http://www.lulu.com/spotlight/blackbirdcraven

You may also be interested in...

Comments and Discussions

 
QuestionWhy you should not write a CodeProject article while drunk... Pin
Wing Flanagan25-Nov-14 8:56
memberWing Flanagan25-Nov-14 8:56 
SuggestionRe: Why you should not write a CodeProject article while drunk... Pin
jediYL30-Nov-14 12:03
memberjediYL30-Nov-14 12:03 
QuestionWhy not create a GitHub project so everybody can contribute ? Pin
fredatcodeproject25-Nov-14 1:42
memberfredatcodeproject25-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
memberfredatcodeproject25-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
memberMember 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
membernewton.saber10-Aug-14 6:07 
GeneralInteresting thoughts! Pin
Douglas Hill9-Aug-14 11:39
memberDouglas 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
memberDouglas 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
memberAssorted 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
memberMember 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    Rant Rant    Admin Admin   

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150901.1 | Last Updated 24 Nov 2014
Article Copyright 2014 by B. Clay Shannon
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid