Skip to content

esaramago/tejo-schedule-2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horários tejo

Horários das travessias de barco do Tejo, operados pela Soflusa e Transtejo.

Get data from Transtejo

https://ttsl.pt/passageiros/horarios-de-ligacoes-fluviais/ligacao-barreiro-terreiro-do-paco/

var times = [];
var th = $0.querySelector('thead').querySelectorAll('td');
var tr =  $0.querySelector('tbody').querySelectorAll('tr');
th.forEach((th, i) => {
	var hour = th.textContent.replace('h', '');
	tr.forEach((tr, j) => {
		var minute = tr.querySelectorAll('td')[i].textContent.replace('*', '');
		if (minute && minute !== '—') {
			var time = {
				'h': hour,
				'm': minute.replace(/\s/g, '')
			}
			if(hour >= 0 && hour < 5) {
            	time.am = true; // add 'am', if agter midnight
			}
			times.push(time);
		}
	});
});
console.log(times)
copy(times)
console.log('copied');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published