E
E
elmander2014-04-04 15:00:55
JavaScript
elmander, 2014-04-04 15:00:55

How to make an application with up-to-date data?

I'm going to make a simple Angular application in the form of a table with up-to-date data from European football leagues. And I got stuck at the stage where you need to decide how to actually get this data. Through JS.
I tried to look for services that would give ready-made jsonp files, but I was disappointed, I didn’t find anything worthwhile.
Then I began to look towards Phantomjs, but the problem here is that in order to get up-to-date data, you need to constantly parse the pages and update the data. And this requires running phantom.exe.
I want to do all this like this:
1) When loading the application itself, get previously generated data from somewhere.
2) Load them into Angular and then work with it.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
G
GreatRash, 2014-04-04
@GreatRash

www.footytube.com/openfooty - have you tried it?

Y
Yunus Gaziev, 2014-04-04
@BBoyJuss

The best solution would be to generate the data separately, on the server, and then give it to the application in finished form. Performance will be great.

D
DastiX, 2015-08-21
@xShimmy

I spied on a cool feature with "virtual columns" in one very large project, now I use it very often in cases similar to yours.
ID | NAME
200 | Send mail options
300 | Job submission parameters
....
ID | CONCEPT | NAME
1 | 200 | Send on Mon
2 | 200 | Send on Tue
3 | 200 | Send Wed
...
10 | 300 | Submit task 1
11 | 300 | Submit task 2
12 | 300 | Submit task 3
...
ID table | NAME
1 | Sasha
2 | Peter
3 | Vasya
...
ID | CONCEPT | USR_ID | PARAMID | VALUE | ACTUAL
1 | 200 | 1 | 1 | 1 | 1 | - We send Sasha mail on Mondays
2 | 200 | 1 | 2 | 1 | 1 | - We send Sasha mail on Tuesdays
3 | 200 | 1 | 3 | 1 | 1 | - We send Sasha mail on Wednesdays
4 | 200 | 2 | 3 | 1 | 1 | - We send Petya mail on Wednesdays
5 | 200 | 3 | 2 | 1 | 1 | - We send Vasya mail on Tuesdays
...
20 | 300 | 1 | 10 | 1 | 1 | - Send Sasha task 1
21 | 300 | 1 | 11 | 1 | 1 | - Send Sasha task 2
22 | 300 | 1 | 12 | 1 | 1 | - Send Sasha task 3
23 | 300 | 2 | 11 | 1 | 1 | - Send Petya task 2
23 | 300 | 3 | 10 | 1 | 1 | - Send Vasya task 1
Request

select 
  u.name as usr,
  p.name as pname,
  x.value as val
from users u 
left join xval x on x.user_id = u.id and x.concept = 200
left join param p on p.id = x.param_id
where u.id = 1

will return you all the parameters for sending mail (concept=200) for Sasha.
USR | PNAME | Val
Sasha | Send on Mon | 1
Sasha | Send on Tue | 1
Sasha | Send on Wed | 1
Need to know which specific tasks to submit?
Just change the concept to 300 and the result will be all the submission tasks for Sasha.
Add some option? Just add a row to the table and that's it!
And no changes to the structure in production and other hemorrhoids.

A
Alexey Lebedev, 2015-08-21
@swanrnd

Boolean field + index is best for searching. This is the best thing to look for.
Bit by bit is better for storage:
1 - setting1
2 - setting2
4 - setting3
6 - setting2+3

I
Igor Kalashnikov, 2015-08-21
@zo0m

I would make a table: user_id, param_name, param_value , and don’t invent
indexes, just arrange user_id to anyone, and maybe param_name (if there are selections by parameter)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question