1
1
function feedLoaded ( result ) {
2
- if ( ! result . error ) {
2
+ if ( result . status === "ok" ) {
3
3
var newsContent = document . getElementById ( "news-list" ) ;
4
4
5
5
var count = 1 ;
6
- var entries = result . entries ;
6
+ var entries = result . items ;
7
7
for ( var i = 0 ; i < entries . length ; i ++ ) {
8
8
var entry = entries [ i ] ;
9
9
try {
@@ -17,7 +17,7 @@ function feedLoaded(result) {
17
17
a . href = entry . link ;
18
18
a . target = "_blank"
19
19
h4 . appendChild ( a ) ;
20
- p . appendChild ( document . createTextNode ( entry . contentSnippet . trim ( ) ) ) ;
20
+ p . appendChild ( document . createTextNode ( entry . content . trim ( ) ) ) ;
21
21
li . appendChild ( h4 ) ;
22
22
li . appendChild ( p ) ;
23
23
newsContent . appendChild ( li ) ;
@@ -31,7 +31,8 @@ function feedLoaded(result) {
31
31
}
32
32
33
33
function shuffle ( array ) {
34
- var currentIndex = array . length , temporaryValue , randomIndex ;
34
+ var currentIndex = array . length ,
35
+ temporaryValue , randomIndex ;
35
36
36
37
while ( 0 !== currentIndex ) {
37
38
@@ -49,18 +50,18 @@ function shuffle(array) {
49
50
function shuffleSupporters ( ) {
50
51
var carouselLink = $ ( ".carousel-img" ) ;
51
52
var shuffled = shuffle ( carouselLink . toArray ( ) ) ;
52
- var srcs = $ . map ( shuffled , function ( x ) {
53
+ var srcs = $ . map ( shuffled , function ( x ) {
53
54
return x . getAttribute ( "src" ) ;
54
55
} ) ;
55
- carouselLink . each ( function ( index , x ) {
56
+ carouselLink . each ( function ( index , x ) {
56
57
x . setAttribute ( "src" , srcs [ index ] ) ;
57
58
} ) ;
58
59
}
59
60
60
61
function shuffleTestimonials ( ) {
61
- $ . getJSON ( "testimonials.json" , function ( data ) {
62
+ $ . getJSON ( "testimonials.json" , function ( data ) {
62
63
var arr = shuffle ( data ) . slice ( 0 , 6 ) ;
63
- var testimonials = $ . map ( arr , function ( x ) {
64
+ var testimonials = $ . map ( arr , function ( x ) {
64
65
var b = document . createElement ( "blockquote" ) ;
65
66
var p = document . createElement ( "p" ) ;
66
67
var link = document . createElement ( "a" ) ;
@@ -84,21 +85,21 @@ function shuffleTestimonials() {
84
85
var col2 = $ ( "#testimonials-col-2" ) ;
85
86
col1 . empty ( ) ;
86
87
col2 . empty ( ) ;
87
- $ . each ( testimonials . slice ( 0 , 3 ) , function ( i , x ) {
88
+ $ . each ( testimonials . slice ( 0 , 3 ) , function ( i , x ) {
88
89
col1 . append ( x ) ;
89
90
} ) ;
90
- $ . each ( testimonials . slice ( 3 ) , function ( i , x ) {
91
+ $ . each ( testimonials . slice ( 3 ) , function ( i , x ) {
91
92
col2 . append ( x ) ;
92
93
} ) ;
93
94
} ) ;
94
95
}
95
96
96
- $ ( function ( ) {
97
+ $ ( function ( ) {
97
98
$ . ajax ( {
98
- url : 'http ://ajax.googleapis .com/ajax/services/feed/load?v=1.0&num=10&callback=?&q =http%3A%2F%2Ffpish .net%2Frss%2Fblogs%2Ftag%2F1%2Ff ~23' ,
99
+ url : 'https ://api.rss2json .com/v1/api.json?rss_url =http://fpish .net/rss/blogs/tag/1/f ~23' ,
99
100
dataType : 'json' ,
100
- success : function ( data ) {
101
- feedLoaded ( data . responseData . feed ) ;
101
+ success : function ( data ) {
102
+ feedLoaded ( data ) ;
102
103
}
103
104
} ) ;
104
105
0 commit comments