Open list of devices safari, chrome or firefox&firebug. Open web inspector (opt-cmd-i in safari), go to instrument tab (ctrl+3). Press "Start Recording" button and refresh page.
In the very bottom of the appeared list find "listDevices.action" and select it. In the right column of a web inspector copy & paste full URL and download JSON file with a list of devices. Then, with a simple regexp (i.e. /\"name\": \"([^\"]+)\",\n\s*\"deviceNumber\": \"([^\"]+)\"/ ) you can get devices' name and number.
Format that Apple accepts for upload is
Device ID Device Name
A123456789012345678901234567890123456789 NAME1
B123456789012345678901234567890123456789 NAME2
Update:
Ah! Apple now provides a full deviceNumber on "iOS devices" page, so it makes whole process easier. Copy-paste the list in, for example, Sublime text and put devices' name and number in a proper order:
find: /^(.*) +([^\n]+)\n/
replace: \2\t\1\n