The 2011 Scripting Games Advanced Event 7: Map User's Names and Twitter Names with PowerShell

Avatar

2011 Scripting Games badge

Summary: Advanced Event 7 in 2011 Scripting Games uses Windows PowerShell to map user’s names to Twitter names.

About this event

Division

Advanced

Date of Event

4/12/2011 12:15 AM

Due Date

4/19/2011 12:15 AM

Event scenario

You are enjoying using Twitter. Unfortunately, Twitter usernames are not always easily understandable. You would like to be able to map a Twitter username with the person’s actual name. To do this, you plan to retrieve this information from a SQL Saturday networking web page, such as the one shown in the following image. Then you plan to create a comma-separated value (CSV) file with the Twitter username, and the person’s actual name as fields.

Design points

  • You should include a function in your script that provides the ability to perform a lookup from the CSV file that will “translate” a user’s name to a Twitter username. The function should also be able to translate from a Twitter username to a person’s real name.
  • For the purposes of this exercise, use the Columbia, South Carolina Networking page for the SQL Saturday #70 (March 19, 2011) event. The URL for the networking page of this event is:
    http://www.sqlsaturday.com/70/networking.aspx
  • If you use a temporary file during the process of obtaining Twitter usernames from the networking page, delete the file prior to completing the script.
  • When you are obtaining the Twitter usernames, do not include the at sign or twitter.com. Therefore, the Twitter username is ScriptingGuys, not twitter.com/scriptingguys or @ScriptingGuys.
  • Extra points for reusable code.
  • Extra points for adding useful Help information complete with sample usage.
  • Although there are certain similarities with Advanced Event 6, there are significant differences. You might be better off starting from “scratch” when you approach this event (or not—depending on how you wrote the solution for the previous event).

2011 Scripting Games: All Links on One Page

Submit your scripts on PoshCode

Support our Sponsors!

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. Good luck as you compete in this year’s Scripting Games. We wish you well.

Ed Wilson, Microsoft Scripting Guy

0 comments

Comments are closed.