Step 1: Needed materials
1. A webcam (I used a quickcam 4000 from logitech I still had)
2. A telelens, the more focal length the more magnification you'll get, the lens I'm using here is 80-210mm, you can get them at ebay starting from 12dollars. Many people have old tele lenses left from the analog camera era so there are plenty of them on the web.
3. Some standard pvc plumbing materials: pvc pipes, a diameter adapter to fit different diameters and some end caps. What you need precisely depends on your lens. More details on this can be seen on the next steps.
4. It's not part of the telescope itself, but it is important to have a tripod since the magnification is very large so any movement will ge greatly magnified. So without a tripod as a stable base, you won't be able to use your telescope.
Step 2: Connect the webcam to the lens
Next you have to go to the local hardware store and find the pvc part that fits your lens or gets very very close to fitting so you can easily fill up the gap with some tightly wound tape. I made 2 of these telescopes and didn't have problems finding a perfect match, but that could just be luck. You'll also need an endcap for this phase.
Make a hole just as large as the optical tube of the webcam exactly in the middle of the endcap. It must be exactly, or performance will reduce. Now you can put everything together. Fit the adapter to the lens, put on the endcap (I needed an extra piece of pipe to reach the endcap diameter) and put the webcam in. The hole in my encap was to tight I could just lock the webcam in. If yours is a little looser, use some tape. The webcam must be about 3cm behind the rear end of the tele lens.
Now you can try it. Hook it up to a pc and put it on a tripod. Aim at something more than 50 meters away and see if you can focus by turning the focus ring of the tele lens. If you can't, then you must play with the distance between the tele lens and the webcam. You may need to change the length of the adapter a bit. Once this is done, you can glue (or tape) everything together. Make sure that all the parts are perfectly aligned in a straight line, this is also vital for the best results.
Step 3: Make a housing for the webcam
On the pictures, you can see the various stages of assembly. One endcap needs quite a big hole, otherwise the parts on the pcb will touch the endcap tilting the webcam pcb which is bad for optical quality.