For Pebble's running version 1 software you cannot access the internet natively. But you can use the app httpebble as a "network gateway". For code examples look at Katharine's GitHub Page.
For Pebble's running version 2 software you can natively access the internet and fetch data, See the Pebble docs for more information.
As of 01/03/14, version 2 software has not been released to the public.