Twitter has inked a deal with the National Basketball Association (NBA) to broadcast live programming via the social media site.