How to upload data from my personal weather station? - upload

How can I contribute and UPLOAD PWS data to wunderground.com? Is there an API documentation available out there?
I found an API showing how to RETRIEVE data from the PWSs:
https://weather.com/swagger-docs/call-for-code
curl -X GET "https://api.weather.com/v2/pws/observations/current?stationId=KMAHANOV10&format=json&units=m&apiKey=adsf" -H "accept: application/json" -H "Accept-Encoding: gzip"
From asking Dr Google I also found:
https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?QUERY_PARAMS
Is that the place to make data available? But where is an API doc available?

see https://feedback.weather.com/customer/en/portal/articles/2924682-pws-upload-protocol?b_id=17298 - important is the parameter b_id, thanks to Google having it in the index.

Related

How to send a POST request with OAUTH in Lua

So I want to tweet on Twitter by sending a POST request to the Twitter API.
I have not found a simple way to do this (unless I use a wrapper), and I'm not too experienced with Lua.
This is Twitter's own example using curl:
$ curl --request POST
--url 'https://api.twitter.com/1.1/statuses/update.json?
status=Test%20tweet%20using%20the%20POST%20statuses%2Fupdate%20endpoint'
--header 'authorization: OAuth oauth_consumer_key="YOUR_CONSUMER_KEY",
oauth_nonce="AUTO_GENERATED_NONCE", oauth_signature="AUTO_GENERATED_SIGNATURE",
oauth_signature_method="HMAC-SHA1", oauth_timestamp="AUTO_GENERATED_TIMESTAMP",
oauth_token="USERS_ACCESS_TOKEN", oauth_version="1.0"'
--header 'content-type: application/json'
But from some wrappers I've seen, it seems that you can use:
consumer_key
consumer_secret
access_token
access_token_secret
I just want a simple way of tweeting without being able to have all of the other API functionality that the Twitter API has. So no wrapper or anything. Just a simple script, but I can't seem to figure it out. Any help is greatly appreciated.
Use a specialized Lua library for Twitter, e.g. https://github.com/leafo/lua-twitter
luarocks install https://luarocks.org/manifests/leafo/twitter-dev-1.rockspec
or a more general Lua library for OAuth, e.g. https://github.com/ignacio/LuaOAuth and do the rest yourself.

Want to write api of twitter to post tweet without any gem/library means with curl command

I am new to ruby want to create an api which post tweet to twitter without help of any gem include as we did on command line by running below code:
curl --request 'POST' 'https://api.twitter.com/1.1/statuses/update.json' --data 'status=Maybe+he%27ll+finally+find+his+keys.+%23peterfalk' --header 'Authorization: OAuth oauth_consumer_key="i6baQCTt1sCXAo8YWcKhuly9Z", oauth_nonce="12f94f3e4b2ded3bbfdfe781de60ae73", oauth_signature="x6%2Fi2w%2F0RjN4prcFmA5HthOZU3Q%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1461568353", oauth_token="2291131736-LpQkfe5diMTung5mVQ0Dc5EKA9u8qnIgWuPqau9", oauth_version="1.0"' --verbose
But in controller how can we use this command so it get ouath_signature and post the tweet.
As In php it did with curl want same way ion ruby.
Please help me to get out of it
You may use rest-client to make your api calls.
Or if you really don't even want to use that gem also.
Try this : http://ruby-doc.org/stdlib-2.3.0/libdoc/net/http/rdoc/Net/HTTP.html
which comes with the ruby standard library
If I understand correctly, you can use:
http://ruby-doc.org/stdlib-2.3.0/libdoc/net/http/rdoc/Net/HTTP.html

How to get the stream key for twitch.tv

I write an app for broadcasting to twitch.tv using C++. For that streaming I need to know the user stream key, usually an user gets that key from the page,
http://www.twitch.tv/user_name/dashboard/streamkey
But I would like get it via my app by using the user name/password.
Any ideas?
You will get it here (change "yourtwitch" by your twitch nickname")
http://www.twitch.tv/yourtwitch/dashboard/streamkey
The link simply moved. You can get this link on the main page of twitch.tv, click on your name then "Dashboard".
This may be an old thread but I came across it and figured that I would give a final answer.
The twitch api is json based and to recieve your stream key you need to authorize your app for use with the api. You do so under the connections tab within your profile on twitch.tv itself.. Down the bottom of said tab there is "register your app" or something similar. Register it and you'll get a client-id header for your get requests.
Now you need to attach your Oauthv2 key to your headers or as a param during the query to the following get request.
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth ' \
-X GET https://api.twitch.tv/kraken/channel
documentataion here
As you can see in the documentation above, if you've done these two things, your stream key will be made available to you.
As I said - Sorry for the bump but some people do find it hard to read the twitch* api.
Hope that helps somebody in the future.
You may obtain the stream key via the API:
https://github.com/justintv/twitch-api
As of January 2018 the url is https://www.twitch.tv/username/dashboard/settings/streamkey

Twilio Client - Answering machine detection

I am developing an iOS application with Twilio. We have used TWIML on the server side. I read in one of the threads that Answering machine detection is not possible when using verb. Can i have the server code using twilio rest apis? if yes, please provide some sample code.
The voice url is not called when the call is connected. It calls when the call is ringing.
Whats the best way to solve my problem?
There is now enhanced Answering Machine Detection.
For example, the MachineDetection parameter can be Enable or DetectMessageEnd. Enable returns results as soon as recognition is complete. DetectMessageEnd will wait until after a greeting to return results if an answering machine is detected.
Using new AMD would look like this as seen in the docs:
curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXX123456789/Calls.json' -X POST \
--data-urlencode 'To=+1562300000' \
--data-urlencode 'From=+18180000000' \
--data-urlencode 'MachineDetection=Enable' \
--data-urlencode 'Url=https://handler.twilio.com/twiml/EH8ccdbd7f0b8fe34357da8ce87ebe5a16' \
-u ACXXXXXXXXXXXXXXXX123456789:[AuthToken]
Twilio evangelist here.
To configure an outgoing call to use AMD, you add the ifMachine parameter to your API request. Here is some more information about AMD:
https://www.twilio.com/docs/api/rest/making-calls#post-parameters-optional
Hope that helps.

searching for tweets from multiple users with api 1.1

Ever since I upgraded to api 1.1, I am unable to search for tweets from multiple users. For example this search-https://api.twitter.com/1.1/search/tweets.json?q=from:commute_by_bike OR from:BikeLeague OR from:peopleforbikes OR from:bikesbelong &count=20 returns zero tweets. This worked previously with the 1.0 api. If I search for just one of these users, I get the corrects results so I know the authentication is working. Any suggestions? thanks.
I've tested the query you post above and using the following curl command (which I got from Twitter's OAuth tool), and I get several tweet results back. Your actual query does work, there is probably just a problem with the formatting somewhere. Retry your query using the OAuth tool to troubleshoot out any formatting problems, then edit your query.
curl --get 'https://api.twitter.com/1.1/search/tweets.json' \
--data 'count=20&q=from%3Acommute_by_bike+OR+from%3ABikeLeague+OR+from%3Apeopleforbikes+OR+from%3Abikesbelong+' \
--header 'Authorization: OAuth oauth_consumer_key="XXXXXXXX", oauth_nonce="XXXXXXXX", oauth_signature="XXXXXXXX", oauth_signature_method="XXXXXXX", oauth_timestamp="XXXXXXXXX", oauth_token="XXXXXXXX", oauth_version="1.0"' --verbose
With the new 1.1 api, I'm searching for a hashtag with the following line of code:
[NSString stringWithFormat:#"https://api.twitter.com/1.1/search/tweets.json?q=%%23%#&result_type=mixed", hashtag]
Where hashtag is an NSString, not containing the #. You need authentication for that, but you mentioned that the authentication works. Good luck!

Resources