From the United Mileage Plus rules on united.com:
Air mileage will not be credited for travel on free tickets, including tickets issued as Mileage Plus awards; on travel industry, free or reduced tickets; consolidation tickets; or on tickets which are issued subject to any accumulation of Mileage Plus credit. In addition, some fares or tickets, including those sold over the Internet, may at United's discretion be excluded from eligibility for mileage accrual.
(I think that the last line there applies to hotwire and priceline tickets.)
In addition, there are several threads here about lack of mileage credit for tickets purchased on hotwire, including this one:
http://www.flyertalk.com/forum/showthread.php?t=518007
To go back to your original question, I think your discount ticket purchased from a travel agent will likely earn miles.