Loading files into folder and read <li> tag content
Hello experts,
I'd like to know How I can import list from other files:
- Files_to_list
- ├── list_files.html
- ├── list_1.html
- ├── list_2.html
- ├── list_3.html
- _______________________________
- Structure of list_1.html
- _______________________________
- <ul class="list-content">
- <li class="article-item">
- <div class="text-container">
- <div class="article-status"><span class="article-status-label">Publicado</span></div>
- <div class="article-title">Você costuma sonhar com fantasmas? Você está desconectado, entenda aqui</div>
- <div class="footer">
- <div class="article-info">
- <span class="article-info-item comments">0 comentários</span>
- <span class="article-info-item">368 recomendações</span>
- <span class="article-info-item">9 cliques</span>
- <span class="article-info-item">2018-03-12 </span></div>
- </div>
- </div>
- </li>
- <li class="article-item">
- <div class="text-container">
- <div class="article-status"><span class="article-status-label">Publicado</span></div>
- <div class="article-title">Bom dia Aquário, sua previsão do amor&sexo para Seg e Ter (13.03)</div>
- <div class="footer">
- <div class="article-info"><span class="article-info-item comments">0 comentários</span><span class="article-info-item">275 recomendações</span><span class="article-info-item">22 cliques</span><span class="article-info-item">2018-03-12 </span></div>
- </div>
- </div>
- </li>
- </ul>
- _______________________________
- Structure of list_files.html
- _______________________________
- <!DOCTYPE html>
- <html lang="pt">
- <head>
- <title>Lista de Posts</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- var $table = $(".article-item").length;
- //alert('Tulio o total é: '+$table);
- var i= 1;
- var $status, $titulo, $comments, $items, $item1,$item2,$item3;
-
- $('.article-item').each(function(){
- //$status = $(this).text();
- $status = $(this).find('.article-status-label').text();
- $titulo = $(this).find('.article-title').text();
- $items = $(this).find('.article-info-item').text().split(' ');
- $comments = $items[0].replace(/[^0-9]/g, '');
- $item1 = $items[1].replace(/[^0-9]/g, '');
- $item2 = $items[2].replace(/[^0-9]/g, '');
- $item3 = $items[3].replace(/[^0-9]/g, '');
- $('#myTable').append('<tr id='+i+'><td>'+i+'</td><td>'+$status+'</td><td>'+$titulo+'</td><td>'+$comments+'</td><td>'+$item1+'</td><td>'+$item2+'</td><td>'+$item3+'</td></tr>');
- i++;
- });
- });
- </script>
- <style type="text/css">
- ul{
- display:none;
- }
- </style>
- </head>
- <body>
- <table id="myTable" class="table">
- <tbody>
- <tr>
- <td>ID</td>
- <td>Status</td>
- <td>Titulo</td>
- <td>Comentarios</td>
- <td>Recomendações</td>
- <td>Clicks</td>
- <td>data</td>
- </tr>
- </tbody>
- </table>
- <!-- ADD HERE -->
- _______________________________
- Result of list_files.html
- _______________________________
- 4 rows in set (0.00 sec) - [Button Copy To Clipboard]
- +------+--------+----------------------+------------------------------------+---------------------------+------------------+-------------------+
- | ID | File | article-status-label | article-title | article-info-item comments| article-info-item| article-info-item |
- +------+--------+----------------------+------------------------------------+---------------------------+------------------+-------------------+
- | 1 | list_1 | Publicado | Você costuma sonhar com fantasmas? | 10 | 9 | 368 |
- | 2 | list_1 | Publicado | Title test 123 | 5 | 12 | 123 |
- | 3 | list_2 | Cancelado | Title test 456 | 196 | 32 | 94 |
- | 4 | list_3 | Cancelado | Title test 789 | 23 | 87 | 12 |
- +------+--------+----------------------+------------------------------------+---------------------------+------------------+-------------------+