Manipulating SurveyMonkey Results & data - surveymonkey

we wud like to webscrape / import surveymonkey results into a html page then approve/decline each survey from/on that page.
We can also use wordpress as a last resort if we must.
Any ideas/tip how we can do this programatically ? Api Tips ???
Tnx

You can use the SurveyMonkey API to fetch the responses and render them how you like.
You can fetch the survey details like this:
GET /v3/surveys/<survey_id>/details
You can fetch the survey responses like this:
GET /v3/surveys/<survey_id>/responses
You can then join the two data together to fill it out. This may be quite a bit of work to render all that yourself though, you may just want to have a list of edit/analyze URLs (provided in the body when fetching responses) and then click through to SurveyMonkey to view the response and decide.
Fetch them in bulk like this:
GET /v3/surveys/<survey_id>/responses/bulk
and make a table with a list of URLs to work with. You may think of other ideas by looking at the API docs.

Related

How do I use importXML/importHTML to retrieve a stock options chain that is hidden?

I am trying to use importXML or importHTML function to retrieve a stock options chain, specifically using this function to get a table. So far, this is what I have:
=importhtml("https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA","table",3)
The problem I'm getting is that I can't retrieve "hidden" tables. For example, if you go on the website: https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA
If you scroll down on this page the hidden tables would only be revealed if you click on ,"show april 2022", "show may 2022", etc. I am trying to retrieve all of this information.
The end result is that I would like to create a table that looks like this:
https://www.barchart.com/stocks/quotes/tsla/put-call-ratios
And a table that looks like this:
https://www.barchart.com/stocks/quotes/TSLA/options?moneyness=10&view=stacked&expiration=2022-04-14-m
As a result, there are two things that I am trying to create, the above tables shown on barchart.
I have tried to use importHTML or importXML on barchart, but it looks like it's not allowed. If there is a way to directly retrieve the information from barchart, that would be a much better solution rather than having to import all of the data separately using a different website.
Please note, that I do have a beginner knowledge, so a step-by-step solution on what to do would be very helpful. Thank you

Microsoft Graph OneNote Patch API removes images after Patch

I am replacing a table content in a OneNote Page by using the PATCH API. In order to do so, I call content API with includeIds option.
Following is an example URL.
https://graph.microsoft.com/v1.0/groups/<id>/onenote/pages/<page-id>/content?includeIds=true
If the table has some images the response of the get with ids looks like this
<img id="img:{cdbee0cc-a1d6-4a42-93f8-e4ff7babab92}{28}" width="480" height="147" src="https://graph.microsoft.com/v1.0/groups('id')/onenote/resources/<page-id>/$value" data-src-type="image/png" data-fullres-src="https://graph.microsoft.com/v1.0/groups('id')/onenote/resources/<page-id>/$value" data-fullres-src-type="image/png" />
After the content returns I modify the part of the table and do a PATCH request.
After the PATCH the image is replaced with a cross sign. Because the URL that is returned is a secure URL and As per the OneNote API the images that we can insert/replace should be either public resources or embedded.
In my case want to keep the the original image with in the table I only want to replace other parts of the table. Is there any work around to solve this problem?
According to the OneNote API (https://learn.microsoft.com/en-us/graph/onenote-update-page#supported-elements-and-actions) you cannot. You can only update image within a div, but you want to update img within a table
As per this documentation, update actions within a table cell are not supported. One more implication of updating elements within a table using PATCH request is that it may mess up with the table structure.
https://learn.microsoft.com/en-us/graph/onenote-update-page#supported-elements-and-actions
When you make you Graph request, you should be able to go to Response Headers>client-request-id. Can you please provide the id that you see there, as well as the time/date that you made the request? Please make sure the time/date is within the past 2 weeks.
Thank you

Retrieving More columns as Part of VSTS query

I'm trying to fetch details from VSTS using VSTS query API. So to get all Portfolio Epics I created a custom query and used its ID to get that in JSON format. the query looks like this
https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql/{id}?api-version=5.0-preview.2
But the issue is its not giving me many details about each of the work items in JSON. It only lists the ID and URL. Like this
WorkItems:[
{ID:234,URL:"workitemurl"},
{ID:235,URL:"workitemurl"},
{ID:236,URL:"workitemurl"},
...
]
So if I need more details about an item I need to execute those individual URl for each PE and thus I can get its details. instead of I am just checking is there is any way of getting an ID (keyedinID of each work item along with the ID and URL) like this. Please note KID is a field if we execute the URL separately. So to avoid that extra process, I would like to get that along with the WorkItems.
WorkItems:[
{ID:234,URL:"workitemurl",KID:002},
{ID:235,URL:"workitemurl",KID:023},
{ID:236,URL:"workitemurl",KID:033},
...
]
So how can we make this possible?
The Web UI uses a different API to get query results (/_api/_wit/_query), which allows query+data in a single pass. This is an old __v5 type call, which means it's considered internal.
The proper way to do this now is to first do the query as you're doing it right now and then call /_api/wit/workitems?ids=1,2,3,4 using the IDs from the references you got from the first call. That will also allow you to load the details dynamically and in small batches which will result in a more responsive UI.
See:
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/list?view=azure-devops-rest-4.1

How can I return all songs by Album (collectionID) from Apple itunes search API

I want to do something like this:
https://itunes.apple.com/lookup?collectionid=211192863&entity=song
But it doesn't return the songs
I'm pretty sure they have such parameter since it is a pretty basic one
any tips are appreciated
Edit:
it seems I can pass ID also, but I don't know if I can trust it once I usd id input for artist search as well
You are very close - the proper API request should be:
https://itunes.apple.com/lookup?id=211192863&entity=song
Note, the first result returned is the Collection meta data, each of the following 12 results are the track meta data.
Your url is wrong, for search API url you should see below:
https://itunes.apple.com/search?id=211192863&entity=song&media=music
enjoy!!!

Twitter API - Display all tweets with a certain hashtag?

How would I go about displaying tweets that contain a certain hashtag using the Twitter API? Thanks
I'd also like to know if there is a way to get all tweets from a certain hashtag in a separate file, also the ones that don't show up in your feed anymore. I suppose that's what the earlier question was about, too.
This answer was written in 2010. The API it uses has since been retired. It is kept for historical interest only.
Search for it.
Make sure include_entities is set to true to get hashtag results. See Tweet Entities
Returns 5 mixed results with Twitter.com user IDs plus entities for the term "blue angels":
GET http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&with_twitter_user_id=true&result_type=mixed
UPDATE for v1.1:
Rather than giving q="search_string" give it q="hashtag" in URL encoded form to return results with HASHTAG ONLY. So your query would become:
GET https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames
%23 is URL encoded form of #. Try the link out in your browser and it should work.
You can optimize the query by adding since_id and max_id parameters detailed here. Hope this helps !
Note: Search API is now a OAUTH authenticated call, so please include your access_tokens to the above call
Updated
Twitter Search doc link:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
The answer here worked better for me as it isolates the search on the hashtag, not just returning results that contain the search string. In the answer above you would still need to parse the JSON response to see if the entities.hashtags array is not empty.

Resources