Yahoo finance api chart - yahoo

The following URL has been used to get chart: https://chart.finance.yahoo.com/t?s=sld&width=250&height=180. Everything was fine. But now I get error: Could not process this "GET" request. What URL should be used now?

I don't know what has happened to yahoo, I get the same response.
After reading your question I decided to update my routines to read from https://www.google.com/finance/getprices?i=60&p=15d&f=d,o,h,l,c,v&df=cpct&q=$ticker instead.
If you do go down that path make sure to take note of the epoch and intervals as mentioned here

Related

Cant figure out, why i get a 403

i try to setup the youtube api but i get a 403.
I tried to setup several times- without success.
https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails&id=-DIJvggBrg8&key=xyz
Maybe someone is able to help me or even login to the console for a setup?
The 403 error by itself is not of immediate use. Its attached error code (as I already pointed out above) sheds light on the things that happened.
The API responds to any query you make with a text (that is structured in JSON format). That response text contains the needed error code.
I suggest you to proceed with the following steps:
delete the old API key (right now it is still accessible!);
create a new API key and
run your API query using the new key and then post here the API response text.
Note that I checked the video -DIJvggBrg8 to which your query refers to with my own API key and got no error but a JSON text describing the video.

Handling POST Request (JSON) in Oracle APEX

We are getting data (JSON file) from a middleware with a POST Request.
Now I need to provide a URL for them to send their POST Request.
The data from the JSON file should then be saved in a database table.
I already tried it with this https://ruepprich.wordpress.com/2016/03/22/apex-rest-post/ but it is not working.
This is my Attempt it is simple and I think people can help me easily with this.
I already created a little program which sends the POST Request to a specific URL so I can test everything, but I just don't get the setup.
Has someone faced similar problems or can send me some resources about that? There are not that many related to APEX so help would be appreciated a lot.
Test it using https://www.getpostman.com/ and you should get more details. Just reading your question is hard to know if your request is failing because of some missing setup, wrong path or something else.

How to disable caching from AFNetworking

I'm using AFNetworking 2.0 to receive response from server. For first response, it works fine. However, after I change the data on the admin site, and verify that the change is made in a browser, then I run the app again, but I still get the previous response. I don't understand why? It seems that AFNetworking is caching the old response. I want to download the current feed. Who can help me, please????
I had the exact opposite problem. I was getting the same image from my server twice, AFNetworking wasn't caching. As I debugged it I realized that I was calling 2 slightly different URLs, in one case I was specifying an option that was the default on the server.
So this gave me the idea for a work around hack for you. It isn't the right answer but it should work. Just pass a useless parameter to the server. Change this parameter for each server call.
https://example.com/myrequest?index=0
then
https://example.com/myrequest?index=1
where index is the unused parameter.
Note: this is actually a pretty gross hack, it should get you running but you really should find the "correct" answer.

Problems attempting to upload image to Twitter via POST in Sinatra

I'm using Sinatra 1.2.6 in Ruby 1.8.7 and I have something like a Twitter client that I'm writing. I am using the Twitter gem version 1.7.2 written by John Nunemaker. For database ORM I'm using Sequel 3.29.0.
Overall, things are working great. I've got a good Oauth sequence working and any user who goes through the Oauth process can post Tweets to my application.
I cannot however for the life of me get media upload working using update_with_media. I'm trying to upload a multi-part octet-stream image file, keep it in memory and then give it to Twitter.
post '/file_upload' do
user_name = params[:user]
if params[:action] == "FILE-UPLOAD"
unless params[:name].match(/\.jpg|png|jpeg/).nil?
#Assume these 3 lines work, and properly authorize to Twitter
current_user = User[:user_name => user_name, :current_account => "1"]
client = current_user.authorize_to_twitter #Handles the Oauth keys/process
client.update("Text status updates work properly")
#Something incorrect is happening in the next two lines.
#I'm either handling the file upload wrong, or posting wrong to Twitter
datafile = params[:file]
client.update_with_media("File upload from Skype: ", datafile)
return "File uploaded ok"
end
end
end
Yet, when I try this, I'm getting:
Twitter::Unauthorized - POST https://upload.twitter.com/1/statuses/update_with_media.json: 401: Could not authenticate with OAuth.
Its saying the line causing this error is the client.update_with_media line.
I am trying to use Rack::RawUpload, but I don't know if I'm using it incorrectly. If I don't need to use it I won't, but I'm just currently stuck. The only thing outside of this code snippet that's using it is this at the top of my code:
require 'rack/raw_upload'
use Rack::RawUpload
Any help on this would be massively appreciated. I've tried messing around with Tempfile.new() as well, but that didn't seem to help much, and I was either getting 401 or 403 errors. I'm fairly new to Ruby, so being as explicit as possible about changes needed would be really helpful.
I should note that I'd like to avoid putting the file on the filesystem if possible. I'm really just passing along the upload here, and I never need access in my scenario to the file on-disk afterward. Keeping the files in-memory is much preferred.
You need to check how your library HTTP headers are setup and logically connected to the POST method you have written here. The thing is that for upload_with_media, twitter api in this gem version requires you to use http://upload.twitter.com upload endpoint instead of the default api endpoint.
The gem may be forcing the api site so while the OAuth based status update works fine, it crashes when you try it with an image. You will need to check the gem documentation to figure out how to force the upload twitter site into the HTTP headers for this method.
Alternatively, consider updating to the latest twitter gem. This is what I got from http://rdoc.info/gems/twitter
The Twitter::API#update_with_media method no longer uses the custom upload.twitter.com endpoint, so media_endpoint configuration has been removed. Likewise, the Twitter::API#search method no longer uses the custom search.twitter.com endpoint, so search_endpoint configuration has also been removed.

How does the Firefox website make its download stats page work?

On the Mozilla website, there’s a page showing (apparently) live download statistics for Firefox: http://www.mozilla.com/en-US/firefox/stats/
How are they performing their request to get the live stats data? I can not see a constant connection in Firebug.
How is this working?
Looking at the country_report.json response in the Net tab of firebug, you can see something like this for each country:
{"total":95843579,"rps":[5,6,6,7,4,9,12,9,3,10,6,8,8,7,5,10,8,4,12,8,10,10,7,4,9,13,9,4,9,13,7,7,6,18,10,7,9,5,3,6,5,11,9,5,6,9,7,2,8,9,11,5,10,7,5,6,11,7,7,2],"count":455,"name":"United States","code":"US"}
So those graphs are not being updated every second in real time. Instead, they are plotting a recent history of requests, one point per second, and periodically requesting a new set of data to plot.
It seems they use something called SQLstream on their end to gather that data.
OK, here goes. The question I don't understand is answered here:
http://blog.mozilla.com/webdev/2009/08/18/download-stats-move-to-mozilla-com/
have fun :-)

Resources