I am using the Google Docs API to update content in a document.
The document has a table of contents, but this doesn't update automatically after making changes in the document using the API.
The only method I've found, is to manually open the document and click the refresh icon next to the table of contents, which will update the TOC.
Is there a way to do this programatically, using the Google Docs API?
The Google Docs API does not make available a method that will allow you to automatically refresh the table of contents in a page programmatically. On top of this, without a TableOfContents already in a document, it is currently not possible to obtain links to heading paragraphs, as detailed on Google’s Issue Tracker. This means that elements can not be fetched to insert without manually pressing the refresh button in the document itself.
A feature request to generate and update a Table of Contents programmatically has been submitted here, which you can indicate is a problem you’re also experiencing and get updates by giving it a star.
Related
I am using Twitter API to post status updates programmatically.
However, when my status contains a link, Twitter automatically adds the preview for that link. Sometimes it's not the desired behaviour, however, I didn't find a property in the API to disable it.
I know we can remove the link preview when posting manually via the Twitter website, as described here Remove Preview Image when Posting a Link on Twitter, so I suspect that it's possible, but API never mentions it.
Also, I am using tweepy library for Python, but happy to resort to the raw POST if that solves my problem.
Any ideas what should I add to the request to prevent the link preview generation?
I actually tried to post to Twitter manually on the web, twice:
With the generated link preview
Explicitly removing the preview (clicking the cross button once the preview is generated)
While doing it, I observed the payload that the website sends to the Twitter servers (with Chrome Dev Tools).
And interestingly enough, the only difference between these two tweets was only one property: card_uri: tombstone://card. More specifically, this property was present in the tweet without the preview.
After that, I actually tried to go and add card_uri property to my status update request, and it actually did the job: the preview was not automatically rendered.
Conviniently, tweepy library has an optional card_uri argument in the update_status menthod.
To sum up, you need to set card_uri='tombstone://card' in your request to prevent Twitter from autogenerating the link previews.
Unfortunately, I didn't find any references to this in the API (or in Google at all), so I am not confident that this is a long-lasting solution, but that's at least something to start with.
First of all, I'm completely incompetent and my hours-long attempts at trying to make this work have been fruitless. So, please, there's someone that can help me.
I have
table id="..........." tablesorter class="........"
They are in the same line of code ad I'm able to scrape until the first element. For me it's important to scrape by the second one. I'm tryng different way but nothing
investing
In the image, in the part highlighted on the left where there is the drop-down menu, it's possible to select the different American markets (Nasdaq, DowJones,
S&P500 etc.). When I select a market other than DowJones, the URL of the page always remains the same, while the part that I highlighted on the right changes (tablesorter class = "............").
In my sheet, I've done this but it can't allow me to scrape different market (only the default table thay you see when open the webpage)
spreadsheet
Your main problem is that IMPORTXML can only retrieve information from static content in websites. Therefore, any content inserted dynamically can't be retrieved by this function.
In your case, you can check what content is not static by heading over to the website https://it.investing.com/equities/americas and then disabling JavaScript on it. To do so if you are using Chrome please follow this guide.
As Javascript will add dynamic content to the site, when you disable it you will observe that the information subject to change with the dropdown doesn't actually change which means that it was dynamically inserted and therefore can't be accessed by IMPORTXML. I have attached an image below showing this.
As a workaround to this you will need to use other web scraping techniques.
If we have a Google Sheets document that has inserted images/drawings in one Google Drive account and we use the API to copy it to another Google Drive account, how do we ensure that the new account has access to the inserted items?
At the moment it appears that the first time the user opens the newly copied document, the image content isn't displayed and when they try to edit the embedded images/drawings they get a warning that they don't have access to those items. However the second time they open the Google Sheet they then can see the items and have access to edit them.
Is this an issue with Google Drive as a whole? Is there anything we can do to work around it?
Narrowed things down a bit without using the API...
Create a sheet and insert a new drawing.
Copy the sheet.
Share the copy with someone else.
They don't have permission to see the drawing.
If you share the original they can see the drawing in the original.
This appears to be an issue with Google Sheets itself, since you replicated the problem using the UI as well. The best place to report product issues is the Google Docs Help Forum.
Currently we're having a request to integrate the Google Form functionality into our system. I'd done some searching on the web, and found that there's no way we can change the post processing of a Google Form unless we do some heavy customization using 3rd party tools.
Thus i have an idea that, when someone fill in the Google Form, he/she will need to fill in a 'user id' in the form. This will be collected as a field in the Google Spreadsheet generated by the form.
In my back end application, i would query the spreadsheet and look for the user id field input by the user. Then i would be able to know whether he/she completed the form or not.
I'm trying to look at the Google Docs API for the spreadsheet and found that there are list-based feed and cell-based feed but i'm not sure which one can achieve what i want to do. Anyone has experience in this can shed a light?
Thank you
Think of a list based feed as being like SQL. You can read rows, insert rows(at the bottom), delete rows and update rows. - you can only store data, not formulas. In contrast, A CELL based feed lets you read and write to cells, any cell, using the cell reference (R1C1 style). CELL FEED give you more control, and includes batch updates.
some sample CELL FEED code is here:
http://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/spreadsheet/cell/CellDemo.java?r=51
Another option is too use google apps script, this is maybe less work if you just want to extract data. The html service is probably the tool for the job https://developers.google.com/apps-script/html_service - as you can dont need OAuth to do the read.
looking for ways to find last modified date on a google fusion table lead me to this post:
https://groups.google.com/d/topic/fusion-tables-users-group/NVEr2TVR88I/discussion
is there a way to find out if the data has changed before syncing it with javascript?
The last modified date is not available through the Fusion Tables API. However, you should be able to get the last modified date through the Drive API (each Fusion Tables is another file in Google Drive).
Use the drive.files.get method with the table id. You can try it out with the API explorer:
https://developers.google.com/apis-explorer/#p/drive/v2/drive.files.get
First click on the button in the top right saying "Authorize requests using OAuth 2.0". Then, put in the fusion table id for the "fileid" field, and click "Execute". You should see all the metadata you want. It will also show you the API call that you need to construct in your application.