PageSourceSearch

https://lookmee.jp/assets/js/news.js

js lookmee.jp collected 2026-10-02 03:51:53 UTC 1,475 bytes, 42 lines download raw bytes

1$(function(){
2  $.ajax({
3      type: 'GET',
4      url: 'https://lookmee.sakura.ne.jp/wp-json/wp/v2/posts?_embed&per_page=3',
5      dataType: 'json'
6  }).done(function(json){
7    var html = '';
8    //記事の件数分イテレートする
9    $.each(json, function( i, row ) {
10      //ブログのタイトル
11      var title = row.title.rendered;
12      //投稿日の取得
13      var date = new Date(row.date);
14      var year=date.getFullYear();
15      var month=date.getMonth() + 1;
16      var day=date.getDate();
17      //カテゴリー名
18      var category = row._embedded["wp:term"][0][0].name;
19      //other_link
20      var other = row.other_link;
21      //ブログのURL
22      var link = row.link.replace("lookmee.sakura.ne.jp","lookmee.jp");
23      //other_linkがあったときの分岐
24      var newsClass = '';
25      var target = '_self';
26      if(other){
27        link = other;
28        newsClass = 'NewWindow';
29        target = '_blank';
30      }
31
32      html += '<article class="News_Item--Wrapper">';
33      html += '<time>' + year + '.' + month + '.' + day + '</time><span class="News_Category">'+ category +'</span>';
34      html += '<h3>' + title + '</h3><a class="' + newsClass + '" href="' + link + '" target="' + target +'"></a>';
35      html += '</article>';
36    });
37    //整形した記事の情報をページに追加する
38    $('.home-News_List').append(html)
39  }).fail(function(json){
40      console.error('記事取得に失敗しました。')
41  });
42});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.