Online tracking of train arrival/departure

#31 Sep 17th, 2011, 22:44
Join Date:
Jun 2010
Location:
Hyderabad, india
Posts:
8,568
  • narendra.d is offline
#31
@pragneshdarji: pl post here:Post your waitlist questions here ONLY
#32 Oct 19th, 2011, 09:17
Join Date:
Oct 2011
Location:
Pune
Posts:
2
  • anilsaxena is offline
#32
How accurate is information provided by trainenquiry.com, also does anybody know phone number of Pune station?
#33 Oct 19th, 2011, 10:21
Join Date:
Jun 2010
Location:
Hyderabad, india
Posts:
8,568
  • narendra.d is offline
#33
pretty close. Use the site, or call 139.
#34 Oct 19th, 2011, 10:33
Join Date:
Oct 2011
Location:
Pune
Posts:
2
  • anilsaxena is offline
#34
Quote:
Originally Posted by narendra.d View Post pretty close. Use the site, or call 139.
Thanks, that what I have been doing so far, just wanted to be sure as my train running 8 hr late, don't want to miss it.
#35 Mar 27th, 2012, 14:16
Join Date:
Feb 2012
Location:
Bhubaneswar, Odisha, India
Posts:
1,595
  • paramiyer is offline
#35
a recent development - thought it might be interesting...
http://www.zdnet.com/blog/india/indi...ng-website/740
#36 Mar 29th, 2012, 09:19
Join Date:
Mar 2012
Location:
chennai
Posts:
1
  • sjolla is offline
#36

How to trace the history of weekly train arrival timings and delays?

How to trace the history of weekly train arrival timings and delays?
#37 Mar 29th, 2012, 10:46
Join Date:
Oct 2009
Location:
Not set
Posts:
1,057
Send a message via Yahoo to Mark_Lester
  • Mark_Lester is offline
#37
Quote:
Originally Posted by sjolla View Post How to trace the history of weekly train arrival timings and delays?
if you are a programmer I can send you a Perl script that will do this that uses trainenquiry.com.
it may need some editing as it hasnt been used for over a year and the trainenquiry inteface may have changed.
The Great Circular Indian Railway Challenge
http://gcirc.wordpress.com

The Great Circular European Railway Challenge
http://gcerc.wordpress.com

Chalo! - Bangladesh Railways Route Finder
currently offline www.chalo.org.uk/
#38 Mar 29th, 2012, 11:08
Join Date:
Feb 2012
Location:
Bhubaneswar, Odisha, India
Posts:
1,595
  • paramiyer is offline
#38
Quote:
Originally Posted by Mark_Lester View Post if you are a programmer I can send you a Perl script that will do this that uses trainenquiry.com.
it may need some editing as it hasnt been used for over a year and the trainenquiry inteface may have changed.
i don't think the interface has changed, but the number of days of past data has certainly come down - looks like now they purge it within 3 days or so...
#39 Mar 29th, 2012, 11:26
Join Date:
Oct 2009
Location:
Not set
Posts:
1,057
Send a message via Yahoo to Mark_Lester
  • Mark_Lester is offline
#39
Quote:
Originally Posted by paramiyer View Post i don't think the interface has changed, but the number of days of past data has certainly come down - looks like now they purge it within 3 days or so...
you run the program every day, actually every hour or how ever often you like, it stores the data in files named after the train numbers, you can set up as many services you want.

here it is, or a version of it. I did say you had to be a programmer, but if any of you like hacking about this is a start.

Quote:
#!/usr//bin/perl

use LWP;
use HTML::TableExtract;
use DateTime;
# Create a user agent object
use LWP::UserAgent;

print "*** GETSTATS ***\n";
mkdir('DATA') if ! -d 'DATA';

my @trains=(
{NUMBER=>9005, DEST=> 'DWK', DAYS=>1, ARRIVAL=>'15:07'},
{NUMBER=>9216, DEST=> 'ADI', DAYS=>1, ARRIVAL=>'07:10'},
{NUMBER=>9223, DEST=> 'JAT', DAYS=>1, ARRIVAL=>'19:25'},
{NUMBER=>2426, DEST=> 'NDLS', DAYS=>1, ARRIVAL=>'05:00'},
{NUMBER=>2436, DEST=> 'NJP', DAYS=>1, ARRIVAL=>'11:45',RUNSON=>4},
{NUMBER=>5959, DEST=> 'RNY', DAYS=>0, ARRIVAL=>'14:05'},
# {NUMBER=>5813, DEST=> 'DMC', DAYS=>1, ARRIVAL=>'05:20'},
{NUMBER=>2423, DEST=> 'NJP', DAYS=>1, ARRIVAL=>'12:55'},
# {NUMBER=>2510, DEST=> 'MAS', DAYS=>2, ARRIVAL=>'04:10',RUNSON=>1},
{NUMBER=>2633, DEST=> 'CAPE', DAYS=>1, ARRIVAL=>'06:50'},
{NUMBER=>2431, DEST=> 'PNVL', DAYS=>1, ARRIVAL=>'18:10',RUNSON=>5},
);

foreach $train (@trains){
get_ruNning_status($train);
}
print "**** GETSTATS END ***\n\n\n";

sub get_ruNning_status{
my($train)=@_;
print "TRAIN $train->{NUMBER} ";
my($day,$month,$year)=get_runn ing_day($train->{ARRIVAL},$train->{DAYS},$train->{RUNSON});
return if !defined $day;
my $ddir="DATA/$day-$month-$year";
my $ddir="DATA/$train->{NUMBER}";
mkdir($ddir) if ! -d $ddir;
if (-f "$ddir/$day-$month-$year") {
print "Already got $ddir/$day-$month-$year\n";
return;
}
my $ua = LWP::UserAgent->new;
$ua->agent("GCIRC/0.1 ");
# Create a request
my $url = "http://www.trainenquiry.com/RunningIslTrSt.aspx?tr=$train->{NUMBER}&st=$train->{DEST}+&dt=$day%2f$month%2f$y ear";
my $req = HTTP::Request->new(GET => $url);
$req->content_type('application/x-www-form-urlencoded');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
$delay_time = get_delay($train->{DEST}, $res->content);
print "DELAY AT $train->{DEST}=", $delay_time ,"\n";
return unless defined $delay_time;
open(DFILE, ">$ddir/$day-$month-$year");
print DFILE "$delay_time\n";
close(DFILE);
open(CSV,">>everything.csv");
print CSV "$train->{NUMBER},$day-$month-$year,$delay_time\n";
close CSV;
}
else {
print $res->status_line, "\n";
}
}

sub get_running_day{
my($eta,$days,$runson)=@_;
my($eta_hour,$eta_minute)=spli t /:/,$eta;
$dt = DateTime->from_epoch(epoch=>time());
$dt->set_time_zone( 'Asia/Calcutta' );
my($hour)=split /:/,$dt->hms();
$days++;
$days++ if $hour < $eta_hour;
$dt = DateTime->from_epoch(epoch=>time()-$days*24*60*60);
$dt->set_time_zone( 'Asia/Calcutta' );
return split /-/, $dt->dmy();
}

sub get_delay{
my $dest = shift;
my $table = shift;
my $te = new HTML::TableExtract( );
$te->parse($table);
return undef unless ($te->tables)[4] && ($te->tables)[4]->rows && (($te->tables)[4]->rows)[3];
my $delay = (($te->tables)[4]->rows)[3][1] ;
$delay =~ s/\s//g;
return $delay;
#40 Mar 29th, 2012, 11:27
Join Date:
Oct 2009
Location:
Not set
Posts:
1,057
Send a message via Yahoo to Mark_Lester
  • Mark_Lester is offline
#40
the formatting got zapped on that, if anyone is serious I'll send you a nice vesion and make sure this is the one I was running for GCIRC.
#41 Jun 19th, 2012, 14:21
Join Date:
Jun 2012
Location:
India
Posts:
2
  • Trainer is offline
#41

Track your train on e-mail

There is a website www.oyatri.com which allows you to track your train. You give your train details and the website sends you updates of train movement.
#42 Jul 28th, 2012, 16:18
Join Date:
Jul 2012
Location:
Lucknow
Posts:
4
  • sidart is offline
#42

Thumbs up

Oyarti.com has a very cool app. But their team needs to work hard on the look and feel of the website.
Present look is not great.
#43 Oct 11th, 2012, 14:41
Join Date:
Jul 2012
Location:
Kochi
Posts:
2
  • subinvsivadas is offline
#43

RailRadar

Hi Everybody,
IR has started a new service Railradar in collaboration with google to track the trains realtime. I think it will be useful for tourists.

regards
#44 Oct 11th, 2012, 20:45
Join Date:
Oct 2010
Location:
Seattle, WA USA
Posts:
30
  • fbdaz is offline
#44

Konkan?

When I looked at it, no trains seemed to be shown along the coast between about Panvel and Mangalore. I wonder if the Konkan Railway is incorporated?
#45 Dec 4th, 2012, 11:07
Join Date:
Aug 2006
Location:
Homeless
Posts:
14,895
  • nycank is offline
#45
SMSing the train number of the trains (I gather only few elite trains) to 09415139139 or 09664139139 gives the location status. Not sure if it is fully rolled out yet. YMMV

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Forum Rules»
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Thread Tools
Display Modes

Search Engine Optimization by vBSEO 3.3.2
© IndiaMike.com 2014
Page Load Success