For a wedding announcement, personally, I would do nothing. If I am not that close to whomever to be invited to the wedding, they will not receive a gift or a card from me. More than likely, I hardly know the couple at all. If it was someone I knew well and knew why I might not be invited to said wedding, I might get them a card.
For a graduation announcement, I would probably send a small, cash gift. There are so many costs going into a high school graduates senior year to begin with, I can understand not being invited to a party, etc. Anyhoo, most times, you only see the graduate for a few minutes as they are more than likely spending time with all their friends at said party. So, I don't feel the need to be invited to a graduation party, per se, unless I know the graduate super well or family of graduate.