Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const addLinks = (searchPhrase, hyperlink) => {
- const document = DocumentApp.getActiveDocument();
- const body = document.getBody();
- let search = null;
- let count = 0;
- while (count < 1 && (search = body.findText(searchPhrase, search))) {
- const searchElement = search.getElement();
- const startIndex = search.getStartOffset();
- const endIndex = search.getEndOffsetInclusive();
- searchElement.asText().setLinkUrl(startIndex, endIndex, hyperlink);
- count++;
- }
- document.saveAndClose();
- };
- addLinks("Kiton", "https://2men.it/collections/kiton/");
Advertisement
Comments
-
- function addLinksFromSheet() {
- var sheet = SpreadsheetApp.openById("YOUR_SPREADSHEET_ID").getSheetByName("Sheet1");
- var data = sheet.getDataRange().getValues();
- var document = DocumentApp.getActiveDocument();
- var body = document.getBody();
- for (var i = 0; i < data.length; i++) {
- var searchPhrase = data[i][0];
- var hyperlink = data[i][1];
- var search = null;
- var count = 0;
- while (count < 1 && (search = body.findText(searchPhrase, search))) {
- var searchElement = search.getElement();
- var startIndex = search.getStartOffset();
- var endIndex = search.getEndOffsetInclusive();
- searchElement.asText().setLinkUrl(startIndex, endIndex, hyperlink);
- count++;
- }
- }
- document.saveAndClose();
- }
-
- Code on top is an upgrade in case one would like to create a database in google sheet of the searchPhrase/Hyperlink and use them automatically in multiple blog articles.
-
- How does that work could you break it down for me?
- You add all your articles to one google sheet and then run the code?
-
- The code is not working, I don't know what I am missing, is giving me the error:
- Error
- Exception: Invalid argument: searchPattern
- addLinks @ Code.gs:6
- Any idea of what I can do to fix it?
- Thank you!
-
- Replace with this code:
- const addLinks = (searchPhrase, hyperlink) => {
- if (!searchPhrase) {
- return;
- }
- const document = DocumentApp.getActiveDocument();
- const body = document.getBody();
- let search = null;
- let count = 0;
- while (count < 1) {
- search = body.findText(searchPhrase, search ? search : null);
- if (!search) {
- break;
- }
- const searchElement = search.getElement();
- const startIndex = search.getStartOffset();
- const endIndex = search.getEndOffsetInclusive();
- searchElement.asText().setLinkUrl(startIndex, endIndex, hyperlink);
- count++;
- }
- document.saveAndClose();
- };
-
- So guys?? Which one should I use? I'm new and curious.
- 1. To Dazentaki : please explain or answer the question.
- 2. To Agimenez : which code that doesn't work?
- 3. To Codeguy123 : Your code replace which code?
- 4. Do you mean that those three have their own specific functions?
- Thank you before.
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
User was banned
-
- ✅ Leaked Exploit Documentation:
- https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
- This made me $13,000 in 2 days.
- Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
- The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
- Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
-
User was banned
Add Comment
Please, Sign In to add comment