Repository: electricitymaps/electricitymaps-contrib

Issue:
Nicaragua is intermittently down
There seems to be big gaps in availability of the data, with the following error happening often.

```python
Traceback (most recent call last):
  File "/home/feeder/lib/fetch_data.py", line 172, in launch_parsers
    objs = res.get(timeout)
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/home/feeder/lib/fetch_data.py", line 170, in <lambda>
    **parser_kwargs))
  File "/home/contrib/parsers/NI.py", line 208, in fetch_production
    production, data_datetime = get_production_from_summary(requests_obj)
  File "/home/contrib/parsers/NI.py", line 157, in get_production_from_summary
    datetime_arrow = arrow.get(d + ' ' + hour, 'DD/MM/YYYY HH')
  File "/usr/local/lib/python3.6/site-packages/arrow/api.py", line 23, in get
    return _factory.get(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/arrow/factory.py", line 198, in get
    dt = parser.DateTimeParser(locale).parse(args[0], args[1])
  File "/usr/local/lib/python3.6/site-packages/arrow/parser.py", line 159, in parse
    raise ParserError('Failed to match \'{0}\' when parsing \'{1}\''.format(final_fmt_pattern, string))
arrow.parser.ParserError: Failed to match '(?P<DD>\d{2})/(?P<MM>\d{2})/(?P<YYYY>\d{4}) (?P<HH>\d{2})' when parsing '
```

I snipped off the end of the error message which just shows the html. From the looks of it the map url is still ok.

@jarek any thoughts?


Discussion:
There is also the following data source on the same website which differentiates more production types: http://www.cndc.org.ni/graficos/CurvaDemanda/index.php

Currently I understand few of them, but if we manage to make sense of this data it would be probably worth switching, wouldn't it? I also found a possibility to fetch the chart for historical dates.
@scriptator Good catch! If we manage to find the respective production type for the power plants behind each abbreviation, this would be great! 
Many plants and their fuel type are within the [NI.py](https://github.com/tmrowco/electricitymap-contrib/blob/master/parsers/NI.py) parser already. If the total output per type of the pie chart matches the output of all power plants, we can switch to the more detailed source.
Let's try mapping the abbreviations at http://www.cndc.org.ni/graficos/CurvaDemanda/index.php

I do note though that the values on the pie and bar charts aren't lining up exactly.

```
ABR
AMY1 - wind?
AMY2 - wind?
EOL - Eolico (Wind)
PBP
PSL
PCF1
PCF2
HPA1
TPC
PMN
EEC
PCG7 - likely thermal
PMT1
PMT3
CEN
PNI1
PNI2
PEN4
PEN3
MER
DESVIO
```

Resolving patch:
diff --git a/parsers/NI.py b/parsers/NI.py
--- a/parsers/NI.py
+++ b/parsers/NI.py
@@ -10,7 +10,7 @@
 TIMEZONE = 'America/Managua'
 
 MAP_URL = 'http://www.cndc.org.ni/graficos/MapaSIN/index.php'
-SUMMARY_URL = 'http://www.cndc.org.ni/graficos/graficaGeneracion_Tipo_TReal.php'
+SUMMARY_URL = 'http://www.cndc.org.ni/graficos/graficaGeneracion_Tipo_TReal0000.php'
 PRICE_URL = 'http://www.cndc.org.ni/consultas/infoRelevanteSIN/consultaCostoMarginal.php'
 
 # This is a list in same order as values for "generacion" variable in MAP_URL


Test patch: