2024-03-26 14:57:54 +01:00
|
|
|
// script à lancer dans le navigateur pour récupérer toutes les séquences d'un compte
|
|
|
|
// pour que cela fonctionne il faut aller sur la page d'un utilisateur, https://www.mapillary.com/app/user/tykayn
|
|
|
|
// puis scroller pour voir toutes les séquences
|
|
|
|
// et lancer ce script dans la console js pour avoir à la fin un tableau de toutes les séquences.
|
|
|
|
|
|
|
|
// ouvrir le drawer de séquene key
|
|
|
|
function toggle_advanced_info () {
|
2024-03-26 15:43:18 +01:00
|
|
|
let _dots = document.querySelector('.i2.three-dots')
|
2024-03-26 14:57:54 +01:00
|
|
|
_dots.click
|
|
|
|
}
|
|
|
|
|
|
|
|
sequences_list = []
|
2024-03-26 15:43:18 +01:00
|
|
|
missing_sequences = []
|
2024-03-26 14:57:54 +01:00
|
|
|
|
|
|
|
function filter_sequences_id () {
|
|
|
|
|
|
|
|
filteredArray = sequences_list.filter(function (item, pos) {
|
|
|
|
return sequences_list.indexOf(item) == pos
|
|
|
|
})
|
|
|
|
console.log('sequences_list', filteredArray)
|
|
|
|
}
|
|
|
|
|
|
|
|
function click_block_number (num) {
|
|
|
|
console.log('click block num', num)
|
|
|
|
let sequence_block = document.querySelector('drawer-sequence-item.ng-star-inserted:nth-child(' + num + ') > a:nth-child(1) > div:nth-child(1) > div:nth-child(1) > i:nth-child(2)')
|
|
|
|
if (sequence_block) {
|
|
|
|
sequence_block.click()
|
|
|
|
} else {
|
|
|
|
console.info('pas de block')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_sequence_id () {
|
|
|
|
|
|
|
|
let id_sequence_container = document.querySelector('.content > div:nth-child(1) > div:nth-child(2) > app-copy-field:nth-child(2) > div:nth-child(1) > div:nth-child(1)')
|
|
|
|
id = id_sequence_container.innerText
|
|
|
|
sequences_list.push(id)
|
2024-03-26 15:43:18 +01:00
|
|
|
console.log('sequence id', id)
|
2024-03-26 14:57:54 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-03-26 15:43:18 +01:00
|
|
|
function check_annoying_modal(){
|
|
|
|
has_annoying_modal = document.querySelector('#close_dialog_box')
|
|
|
|
if (has_annoying_modal) {
|
|
|
|
|
|
|
|
has_annoying_modal.click()
|
|
|
|
toggle_advanced_info()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function iterate_blocks (initial_block = 0, max_block, waiting = 400) {
|
2024-03-26 14:57:54 +01:00
|
|
|
|
|
|
|
// compter les blocs
|
|
|
|
let listing_blocs = document.querySelectorAll('drawer-sequence-item')
|
|
|
|
console.log('listing_blocs', listing_blocs.length)
|
2024-03-26 15:43:18 +01:00
|
|
|
if(!max_block){
|
|
|
|
listing_blocs.length +1
|
|
|
|
}
|
2024-03-26 14:57:54 +01:00
|
|
|
|
|
|
|
// sequences_list = []
|
|
|
|
let ii = 1 * initial_block
|
|
|
|
let jj = 1 * initial_block
|
2024-03-26 15:43:18 +01:00
|
|
|
check_annoying_modal()
|
2024-03-26 14:57:54 +01:00
|
|
|
|
|
|
|
listing_blocs.forEach((elem) => {
|
2024-03-26 15:43:18 +01:00
|
|
|
|
2024-03-26 14:57:54 +01:00
|
|
|
if (ii <= max_block) {
|
2024-03-26 15:43:18 +01:00
|
|
|
check_annoying_modal()
|
|
|
|
console.log('set timeout', (ii * waiting - 1 * initial_block * waiting))
|
|
|
|
let t = setTimeout(() => {
|
|
|
|
|
|
|
|
check_annoying_modal()
|
|
|
|
|
2024-03-26 14:57:54 +01:00
|
|
|
jj++
|
|
|
|
click_block_number(jj)
|
|
|
|
add_sequence_id()
|
2024-03-26 15:43:18 +01:00
|
|
|
clearTimeout(t)
|
|
|
|
}, (ii * waiting - 1 * initial_block * waiting))
|
2024-03-26 14:57:54 +01:00
|
|
|
ii++
|
|
|
|
}
|
2024-03-26 15:43:18 +01:00
|
|
|
|
2024-03-26 14:57:54 +01:00
|
|
|
})
|
2024-03-26 15:43:18 +01:00
|
|
|
|
|
|
|
if (ii === max_block) {
|
|
|
|
filter_sequences_id()
|
|
|
|
}
|
|
|
|
|
2024-03-26 14:57:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// toggle_advanced_info()
|
|
|
|
// on définit un max d'itérations à 20 pour tester, et 300 milisecondes entre chaque
|
2024-03-26 15:43:18 +01:00
|
|
|
iterate_blocks(0, 25, 600)
|
|
|
|
|
|
|
|
// compter
|
|
|
|
document.querySelectorAll('drawer-sequence-item')
|