upload real time ultrasonic sensor data to pubnub using arduino and esp8266
The PubNub website has a link to an Arduino library:

https://github.com/pubnub/arduino

Although it doesn't have specific support for the ESP8266 per se, it does support the Arduino Ethernet Shield, Arduino Wifi Shield and Arduino Wifi101 Shield, so I would imagine it wouldn't be hard to adapt the code.

Be aware that for the Arduino Uno, the SRAM will be fairly limited, where as the  ESP8266 contains 96 KB of DRAM.