urlfetch

Loading stock quotes from TD Ameritrade developer app into Sheets with Google Script

给你一囗甜甜゛ 提交于 2020-04-30 06:39:28
问题 I'm trying to use an API from TD Ameritrade to load stock info into a Google Sheet. I've tried the following code: var ticker = "APPL" var headers = {"Authorization":" Bearer <access token>"} var options = {"headers":headers} var calltoAPI=urlFetchApp.fetch("https://api.tdameritrade.com/v1/marketdata/"+ticker+"/quotes?apikey=<myapikey>",options); I get the error: ReferenceError: urlFetchApp is not defined (line 6, file "Code"). However, in my developer app, I do get a return on APPL. Worth

Loading stock quotes from TD Ameritrade developer app into Sheets with Google Script

落爺英雄遲暮 提交于 2020-04-30 06:39:10
问题 I'm trying to use an API from TD Ameritrade to load stock info into a Google Sheet. I've tried the following code: var ticker = "APPL" var headers = {"Authorization":" Bearer <access token>"} var options = {"headers":headers} var calltoAPI=urlFetchApp.fetch("https://api.tdameritrade.com/v1/marketdata/"+ticker+"/quotes?apikey=<myapikey>",options); I get the error: ReferenceError: urlFetchApp is not defined (line 6, file "Code"). However, in my developer app, I do get a return on APPL. Worth

Anonymous caller does not have storage.objects.get

∥☆過路亽.° 提交于 2020-03-01 04:20:27
问题 On Google App Engine (GAE) written in Python. I am trying to issue an http post to cloud-speech-to-text api and using URI audio source (Google Cloud Storage Bucket Objects). I am using the following headers; Authorization: BASIC encoded_base64(username:password) But I still keep getting an error response below: { "error": { "code": 403, "message": "Anonymous caller does not have storage.objects.get access to bucket_of_secrets/four_score_seven_years.flac.", "status": "PERMISSION_DENIED" } } So

Anonymous caller does not have storage.objects.get

懵懂的女人 提交于 2020-03-01 04:18:02
问题 On Google App Engine (GAE) written in Python. I am trying to issue an http post to cloud-speech-to-text api and using URI audio source (Google Cloud Storage Bucket Objects). I am using the following headers; Authorization: BASIC encoded_base64(username:password) But I still keep getting an error response below: { "error": { "code": 403, "message": "Anonymous caller does not have storage.objects.get access to bucket_of_secrets/four_score_seven_years.flac.", "status": "PERMISSION_DENIED" } } So

App Engine: Alternatives to urlfetch? Seems very unreliable

╄→尐↘猪︶ㄣ 提交于 2020-01-30 04:33:19
问题 I'm using urlfetch in my app and while everything works perfectly fine in the development environment, i'm finding urlfetch to be VERY unreliable when it's actually deployed. Sometimes it works as it should (retrieving data), but then a few minutes later it might return nothing, then it'll be working fine again a few minutes after that. This is very unacceptable. I've checked to make sure it's NOT the source URL that's the problem (YQL) and, again, everything works as it should in the

UrlFetchApp not connecting to public URL

我的未来我决定 提交于 2020-01-25 10:21:31
问题 I'm trying to pull data from this website using the download CSV link found under Actions > Download > CSV https://app.udot.utah.gov/apex/eom/f?p=288:300 I get an error 302 on the UrlFetchApp line consistently and I'm not understanding why. I ran the logger with the httpexception and got the error that it could not connect to the server. The website is public and accessible regardless of network so I'm having a hard time understanding what's going on. The URL seems to download the CSV when

urlfetch redirected into an infinite loop in python

和自甴很熟 提交于 2020-01-14 18:46:46
问题 I am trying to load a url which redirects to itself. I'm assuming its loading a cookie and its looking for it but it never sees it so there is this infinite loop of requests. I have tried urllib2, urlfetch, and httplib2. None work. I tried this though: url = "http://www.cafebonappetit.com/menu/your-cafe/collins-cmc/cafes/details/50/collins-bistro" thing = urllib2.HTTPRedirectHandler() thing2 = urllib2.HTTPCookieProcessor() opener = urllib2.build_opener(thing, thing2) url = 'http://www.nytimes

Cannot fetch image Url (defined with data-original) inside specic class ( JSOUP)

半城伤御伤魂 提交于 2020-01-05 12:11:47
问题 HTML source (Note that it uses lazy load jQuery plugin): 1). When I run code below it fetches all image Urls from website: Elements images=document.select("img[src~=(?i)\\.(png|jpe?g|gif)]"); 2). But when I specify the class it fails, like below: Elements images=document.select("div.newscat img[src~=(?i)\\.(png|jpe?g|gif)]"); And then I employ ( in second case it throws OutOfBoundsException): for (int i=0;i<images.size();i++){ imageUrl[i]=images.get(i).attr("src"); } Could, anyhow, lazy load

A very simple multithreading parallel URL fetching (without queue)

倖福魔咒の 提交于 2019-12-27 11:52:28
问题 I spent a whole day looking for the simplest possible multithreaded URL fetcher in Python, but most scripts I found are using queues or multiprocessing or complex libraries. Finally I wrote one myself, which I am reporting as an answer. Please feel free to suggest any improvement. I guess other people might have been looking for something similar. 回答1: Simplifying your original version as far as possible: import threading import urllib2 import time start = time.time() urls = ["http://www

import private google fusion table to google docs spreadsheet

 ̄綄美尐妖づ 提交于 2019-12-25 07:57:53
问题 I want to build a chart to google fusion table. I know there is an option to do it with fusion table but I need to do that using google spreadsheet. How do I import a private fusion table to a spreadsheet? function getdata(authToken) { query = encodeURIComponent("SELECT * FROM tableid"); var URL = "http://www.google.com/fusiontables/api/query?sql=" + query; var response = UrlFetchApp.fetch(URL, { method: "get", headers: { "Authorization": "GoogleLogin auth=" + authToken, } }); return response