check the fuel solenoid
It's very easy to check the fuel shutdown solenoid and eliminate it from the list of possibilities. My truck acted very much the same. It was an intermittent problem then went away and then came back and wouldn't start at all. I ended up changing the relay and it's been fine since.
To check to see if the fuel shutdown solenoid is the problem:
1. pop the hood
2. try to start the truck, if it doesn't start leave the key in the run position
3. get out and check to see if the solenoid is in the up position, if not push it up
4. if it stays in the up position, try to start the truck again, it should start
If the solenoid is in the up position at step #3 when you check it, then you can eliminate the solenoid as the no start problem.
If the solenoid won't stay up at step #3 then it's probably the solenoid/wiring, if it holds when pushed up then it's probably the relay.
Let us know what you find...