Unfortunately I don’t think you’re going to have much luck attempting to implement this. Twitter’s card crawler has a 7 day refresh window, so unless every URL you share is static and unique this would be pretty difficult to deliver.
There’s certainly no need to use the Twitter API to share cards - you just implement the card meta tags on the static web pages that are then crawled by Twitterbot. When a user posts a Tweet containing the link, a card should be rendered. Unfortunately in order to test this you do need a world-accessible web server, not localhost.