This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setValues(){ | |
| let form = JSON.parse(window.localStorage["form_of_bot"]) | |
| let keys = Object.keys(form) | |
| for(let k of keys){ | |
| $(`input[name="${k}"]`).val(form[k]) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setTimeout(() => { | |
| $(".template-btn-submit").click(() =>{ | |
| scrapeInput() | |
| }) | |
| }, 3000) | |
| function scrapeInput(){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let working = false | |
| // Since ads are loaded via | |
| // ajax, i'm giving it 7 seconds | |
| // to load and render. | |
| setTimeout(() => { | |
| // Check if on remote job page. | |
| // only then, run query. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Since ads are loaded via | |
| // ajax, i'm giving it 7 seconds | |
| // to load and render. | |
| setTimeout(() => { | |
| let working = false | |
| // Check if on remote job page. | |
| // only then, run query. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file := []byte{} | |
| for _, part := range parts { | |
| file = append(file, part...) | |
| } | |
| // Set permissions accordingly, 0700 may not | |
| // be the best choice | |
| err = ioutil.WriteFile("./data.zip", file, 0700) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i := 0; i < workers; i++ { | |
| go download(i, size, results) | |
| } | |
| counter := 0 | |
| for part := range results { | |
| counter++ | |
| parts[part.Index] = part.Data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func download(index, size int, c chan Part) { | |
| client := &http.Client{} | |
| // calculate offset by multiplying | |
| // index with size | |
| start := index * size | |
| // Write data range in correct format | |
| // I'm reducing one from the end size to account for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func main() { | |
| var size int | |
| results := make(chan Part, workers) | |
| parts := [workers][]byte{} | |
| client := &http.Client{} | |
| req, err := http.NewRequest("HEAD", url, nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Part struct { | |
| Data []byte | |
| Index int | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ( | |
| // Sample download file provided by Vodafone | |
| // to test internet | |
| url = "http://212.183.159.230/5MB.zip" | |
| // Number of Goroutines to spawn for download. | |
| workers = 5 | |
| ) |
NewerOlder