I am trying to pull over end-of-day share prices going back in time. The code below provides exactly what I need but it appears that that the year/month/day parameters do not work.
import requests
params={'q': 'NASDAQ:AAPL', 'expd': 10, 'expm': 3, 'expy': 2018, 'output': 'json'}
response = requests.get('https://finance.google.com/finance', params=params, allow_redirects=False, timeout=10.0)
print(response.content)
The closing price for this is "l" : "178.65" which is the most recent closing price (15 March) and not for 10 March as specified. I am assuming I cannot rely on this service as it is no longer supported by Google but would be good if someone can confirm if I am correct around the dates not working or if I am missing something.
Well, up until this morning this used to work:
http://finance.google.com/finance/historical?q=NASDAQ:msft&output=csv&startdate=Mar+15%2c+2018&enddate=Mar+15%2c+2018
I asked two other people to confirm on different ISPs and we all get the same error message:
We're sorry... but your computer or network may be sending automated queries. To protect our users, we can't process your request enter code here`right now. See Google Help for more information.
same here:
https://finance.google.com/finance/historical?q=AAPL&output=csv
it looks like google close finance api or change path.
This URL still works:
https://finance.google.co.uk/bctzjpnsun/historical?q=NASDAQ:msft&output=csv&startdate=Mar+15%2c+2018&enddate=Mar+15%2c+2018
I recommend you to make a copy of the data ASAP though, because Google will probably close this other link soon.
Related
I am trying to build a JavaScript Minecraft bot. I tried Mineflayer, but they do not support version 1.17.1. That's when I found out about node-minecraft-protocol, the library which mineflayer is based out of. They support version 1.17.1! I have been trying to make my bot move for the past three days, but I'm not able to figure it out from the docs. I even tried looking into mineflayer's code! Connecting to the server, sending chat messages, reading chat messages, and reading current position are all fine! It's moving the bot that gives me trouble. Or for that matter, flying, looking or anything similar (that takes f64/f32 values as input). To give you an idea of what I'm trying to achieve, here is something that I have tried running (-181.52092902441308, 84, and 134.53013736121238 are the spawn coordinates):
client.write('position', {
x: -182.52092902441308,
y: 84,
z: 134.53013736121238
})
I fixed it, for anyone who's looking for an answer! The problem was with the 1.17.1 update in the Minecraft protocol. You need to send 'teleport_confirm' with the 'teleportId' sent with the position update in order to actually move the bot.
I just downloaded this report called Analyzing and Visualizing Data with F# and am having a hard time just running the first example. This should probably be expected since the report is 7 years. I am running the first script which is as follows.
#load "packages/FsLab/FsLab.fsx"
open FSharp.Data
open XPlot.GoogleCharts
let wb = WorldBankData.GetDataContext()
wb.Countries
I get an error message that reads
Response from http://api.worldbank.org/country?per_page=1000&format=json&page=1:
{ "statusCode": 404, "message": "Resource not found" }
It looks like the url is broken because it seems that the worldbank has updated its api. When I use the url http://api.worldbank.org/v2/country in my browser it works. I noticed when I went to the source code that they have the base url hard coded in, so I was thinking I would just need to add "v2/" to it and it would work, but I am unfamiliar with how to load a edited library into my script.
Yes, your investigation is correct, even banks sometimes change their APIs :)
As for adding the library to your script, it depends on how your environment looks like, but basically you can fix the problem locally and/or globally.
For the local solution, once you compile your downloaded library with modified url, you can load or reference it as described here.
For the global solution, send a pull request that fixes the link in this file, Tomáš Petřiček (the repo owner) is generally active and should merge it. And you will improve the world a little bit.
I'm working in new application written in Siebel 8.1, issue appears when I'm trying to replay script and I can't handle that.
Replay Output:
Error -27086: Auto-correlation callback function
"flCorrelationCallbackParseWebPage" failed (rc=1) for parameter
"Siebel_Parse_Web_Page40"
web_reg_save_param("Siebel_Parse_Web_Page40",
"LB/IC=",
"RB/IC=",
"Ord=1",
"Search=Body",
"RelFrameId=1",
"AutoCorrelationFunction=flCorrelationCallbackParseWebPage",
"AutoCorrelationDll=LrwiSiebelCorrelationWrapper",
LAST);
I have done all steps for prepare record options from: http://software-qe.blogspot.se/2008/01/siebel-7x-record-and-replay-for.html
I'm using Loadrunner 11.52 (Siebel Web protocol), IE8.
We've been using the autocorrelation library for quite a few years on my team and we see this a lot. Unfortunately, it's not an easy problem to diagnose.
First I would check your test results and your VUser log to see if something happened before the autocorrelation failed. (Make sure your logging is set to parameter substitution in runtime settings).
Check your parameter files for extra spaces, commas, etc. Sometimes I've seen that error right after it rejects something about your parameter file.
Worst case scenario, your script is corrupted and you'll have to start over. We've gotten in the habit of making frequent backups of our scripts just because of this issue. Usually, we'll be able to start from our backup and continue or create a new script and paste the old code in. Autocorrelation error "magically" goes away with the same code in a new script.
If auto(magical)correlation does not work then use manual correlation.
Record twice with same data: Compare. You will find session, state and time data.
Change the credentials: Re-record. Compare. You will find credential related correlation
Change the business record but keep the same business process. Re-Record. You will find the business related correlation.
Do not expect autocorrelation to provide a magical working script. You have about a 0.0001% chance of that happening without LoadRunner script development intervenetion.
I'm trying to set X-Delete-After and X-Delete-At to a file i'm uploading.
So i tired :
FileMetaData.Add("X-Delete-After", "30");
cloudFilesProvider.UpdateObjectMetadata(inStrContainerID, strDesFileName, FileMetaData);
but the header did not get recognized.
is that the right approach?
Edit: I'm trying to use ICloudFilesMetadataProcessor.ProcessMetadata, but really have no clue how to and am not able to find any documentation.
In the current release of the SDK, you can include the X-Delete-After or X-Delete-At value in the headers argument to the following calls:
IObjectStorageProvider.CreateObject
IObjectStorageProvider.CreateObjectFromFile
Currently there is no way in the SDK to change the value of this header after the file has already been uploaded (e.g. using UpdateObjectMetadata as you suggest in the question would set the values X-Object-Meta-X-Delete-After or X-Object-Meta-X-Delete-After, which is not correct).
Here is a related issue on GitHub:
#167: How to assign version folder
Gopstar --
EDITED:
After more investigation; I set the X-Delete-After to 1500 and the code worked. Sort of. When viewing the file header information via the dashboard, the X-Delete-At was set.
However, the result was correct; the X-Delete-At was equal to what would be 1500 seconds from the time I set it.
Original reply:
I played around; if you set the value higher (for example, I tried X-Delete-After = 3000) it will work.
I do NOT know the lowest number acceptable, but I'm sure someone will chime in with the number.
Hope this give SOME help.
Wow, that title was a mouthful...
I'm sure that sounds very confusing at first glance. This is the basis of what I've got going on:
I have:
-a server set up with Asterisk and Voxeo Prophecy running on it.
-Prophecy set up as extension for Asterisk.
-another server running an external application.
The external application generates some two XMLs: one ccxml and one vxml file, for Voxeo to read and execute, which then initiates a call to (up until today) an asterisk extension.
The project is moving along, though, and yesterday I got a SIP Trunk and a DID number in hopes to turn this application into something that can call real people.
The trunk is working on Asterisk, and I've been able to initiate calls through a softphone (X-lite) to my cell phone number. That works just fine.
However, when I try to initiate calls from the external application, it does not go through. I've tried numerous things to try to fix it but it's just not working.
Prior to the trunk/DID business, the working code to call an asterisk extension was as follows:
<createcall>dest="'sip:*Extension here*#*IP Address here*'"
connectionid="myOutBoundConnectionID" timeout="'45s'" callerid="'*Extension here*
#*IP Address here*'"</createcall>
My first thought was that I might need to have a trunk specified for Prophecy as well as for Asterisk, but I'm probably way off base.
The reformatted code that I thought would work was as follows:
<createcall>dest="'tel:*Phone Number here*'" connectionid=
"myOutBoundConnectionID" timeout="'45s'" callerid="'*Phone Number here*
'"</createcall>
...but this does not work at all.
The log files say things like this when I call from my softphone:
-- Executing [*My phone number*#from-internal:1] Macro("SIP/1001-0000007d", "user-
callerid,LIMIT,") in new stack
but when I call from the external application, things are a little different:
-- Executing [*My phone number*#from-sip-external:1] NoOp("SIP/*IP Address:5080-0000007c",
"Received incoming SIP connection from unknown peer to *phone number*") in new stack
Can anyone shed some light on what is happening here? Thanks in advance!
You should make your reformatted create call look something like this:
<createcall>dest="'tel:*Phone Number here*#*IP Address of Asterisk*'" connectionid= "myOutBoundConnectionID" timeout="'45s'" callerid= "'*Prophecy's Asterisk Extension'"</createcall>
Make sure your Asterisk server has an outbound rule to hit 10-digit phone number via your SIP trunk (I assume it does if your softphone calls work.
Depending on your SIP provider, this may result in your outbound calls appearing to come from the Extension number, not whatever external number you want to present. If you wish to present another number, you probably need to get prophecy to register the SIP station it uses, if you haven't already (in Prophecy's config.xml), in fact you may need/have to do this anyway before this will work.