-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.java
More file actions
62 lines (37 loc) · 1.19 KB
/
Utils.java
File metadata and controls
62 lines (37 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.cleveroad.sample.utils;
import android.util.Log;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
/**
* Created by Dany on 17/11/2017.
*/
class Utils {
public static List<Word> getApiUserList(String value){
try
{
Document document = Jsoup.connect("http://www.rimessolides.com/motscles.aspx?m=" +value ).get();
ArrayList<Word> wordList = new ArrayList<>();
Word word;
Elements elements = document.getElementsByClass("MotCle");
for (Element e : elements) {
word = new Word();
// On récupère l'image
word.setWord(e.getElementsByTag("a").first().text());
wordList.add(word);
}
return wordList;
} catch (IOException e) {
e.printStackTrace();
Log.e("Error", e.getMessage());
}
return null;
}
}