Could I only get swine flu if I eat pork?

No. Pork has nothing to do with swine flu.

You can get it without being in contact with pigs.
Not by eating pork. You can be infected with swine flu (h1n1) if you inhale the virus, when someone who is infected sneezes, coughs next to you and you inhale the infected droplets from the cough or sneeze or you touch your nose/mouth after you infect your hands by shaking hands with an infected person who has the virus on theirs after wiping their nose/mouth with their hands, or infected pigs respiratory secretion.