public IObservable <IStreamMessage> DirectAsObservable(string host = null) { var url = ToUrl(host, "/api/v1/streaming/direct"); var connection = new StreamingConnection(Client, url); return(connection.Connect()); }
public IObservable <IStreamMessage> ListAsObservable(long id, string host = null) { var url = ToUrl(host, "/api/v1/streaming/list"); var parameters = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("list", id) }; var connection = new StreamingConnection(Client, url, parameters); return(connection.Connect()); }
public IObservable <IStreamMessage> LocalHashtagAsObservable(string tag, string host = null) { var url = ToUrl(host, "/api/v1/streaming/hashtag/local"); var parameters = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("tag", AppClient.UrlEncode(tag)) }; var connection = new StreamingConnection(Client, url, parameters); return(connection.Connect()); }
public IObservable <IStreamMessage> LocalPublicAsObservable(bool isOnlyMedia, string host = null) { var url = ToUrl(host, "/api/v1/streaming/public/local"); var parameters = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("only_media", isOnlyMedia.ToString().ToLower()) }; var connection = new StreamingConnection(Client, url, parameters); return(connection.Connect()); }
public async Task ConnectAsync(string host = null) { var url = $"wss://{(string.IsNullOrWhiteSpace(host) ? Client.Domain : host)}/streaming"; var parameters = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("i", Client.EncryptedAccessToken) }; _connection = new StreamingConnection(Client, url, parameters); _observable = _connection.Connect(); _disposable = _observable.Connect(); // start await _connection.WaitForConnectionEstablished().Stay(); }
public IObservable <IStreamMessage> DirectAsObservable(string host = null) { var url = ToUrl(host, "/api/v1/streaming"); var parameters = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("stream", "direct"), new KeyValuePair <string, object>("access_token", Client.AccessToken) }; var connection = new StreamingConnection(Client, url, parameters); return(connection.Connect()); }