Logicsystem360 | Mr Marron derriere a écrit :
apres faudra rajouter la possibilité de faire des stats, en isolant, des annees, des mois, des semaines, voir à par heure qui poste le plus, et le volume de post par pseudo au fil des journées,. le voluime total en nombre de mot par pseudo, enfin, tout ce qui peut être intéessant quoi
de quoi t'occuper pendant ta convalescence 
|
je note l'idéé on verra si j'ai pas la fleme
xCt a écrit :
logic si ca te dérange pas de partager ton travail je veux bien jeter un oeil sur le prog (si c'est du java de près ou de loin)
|
Non pas de souci, fait à la truelle
Code :
- import java.io.IOException;
- import java.util.*;
- import java.util.List;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Element;
- import org.jsoup.select.Elements;
- public class Pseudo {
- //paramètres
- public final static int minpost=10;
- public final static int pag1=1;
- public final static int pag2=26111;
- public final static int topic=12072;
- public final static int cat=13;
- public final static int subcat=431;
- //constantes
- public static List<String> pseudo = new ArrayList<String>();
- public static int place=1;
- public static int pub=((pag2-pag1)*2);
- public static void main(String[] args) throws Exception{
- remplirTab(pag1, pag2, topic, subcat, cat);
-
- Map<String, Integer> map = new HashMap<String, Integer>();
-
- for (String temp : pseudo) {
- Integer count = map.get(temp);
- map.put(temp, (count == null) ? 1 : count + 1);
- }
- Set<Map.Entry<String,Integer>> set = new TreeSet<Map.Entry<String,Integer>>(
- new Comparator<Map.Entry<String,Integer>>(){
- @Override
- public int compare(Map.Entry<String,Integer> obj1, Map.Entry<String,Integer> obj2) {
- Integer val1 = obj1.getValue();
- Integer val2 = obj2.getValue();
- int compareValues = val2.compareTo(val1);
- if ( compareValues == 0 ) {
- String key1 = obj1.getKey();
- String key2 = obj2.getKey();
- int compareKeys = key1.compareTo(key2);
- if ( compareKeys == 0 ) {
- return 0;
- }
- return compareKeys;
- }
- return compareValues;
- }
- }
- );
- set.addAll(map.entrySet());
-
- System.out.println("Liste des pseudos : " );
- for ( Map.Entry<String,Integer> entry : set ) {
- if(entry.getValue()>=minpost){
- System.out.println(place + "/ " + entry.getValue() + " -> " + entry.getKey());
- place++;
- }
- }
- System.out.println("Début : " + remplirDate(pag1, topic, subcat, cat));
- }
-
- public static String urlPage(int page, int topic, int subcat, int cat){
- String url = "http://forum.hardware.fr/forum2.php?config=hfr.inc&cat={$cat}&subcat={$subcat}&post={$topic}&page={$page}&p=1&sondage=0&owntopic=1&trash=0&trash_post=0&print=0&numreponse=0"e_only=0&new=0&nojs=0#bas";
- url = url.replaceFirst("\\{\\$page\\}", String.valueOf(page));
- url = url.replaceFirst("\\{\\$topic\\}", String.valueOf(topic));
- url = url.replaceFirst("\\{\\$subcat\\}", String.valueOf(subcat));
- url = url.replaceFirst("\\{\\$cat\\}", String.valueOf(cat));
- return url;
- }
-
- public static void remplirTab (int page1, int page2, int topic, int subcat, int cat) throws IOException{
- int cpt;
- int p=0;
- int cp = page2-page1;
- double trait = cp/100;
- int pour=0;
- System.out.print("Chargement des topics : " );
- for(cpt=page1;cpt<page2;cpt++)
- {
- org.jsoup.nodes.Document doc = Jsoup.connect(urlPage(cpt, topic, subcat, cat)).userAgent("Mozilla" ).timeout(0).get();
- for(int i=0; i<40;i++)
- {
- Elements element = doc.select("table.messagetable td.messCase1 b.s2" ).eq(i);
- String titre = element.text();
- pseudo.add(titre);
- }
- p++;
- if(p>trait){
- pour++;
- System.out.print(pour + " " );
- p=0;
- }
- }
- System.out.println(" Done" );
- System.out.println();
- }
-
- public static String remplirDate (int page, int topic, int subcat, int cat) throws IOException{
- org.jsoup.nodes.Document doc1 = Jsoup.connect(urlPage(page, topic, subcat, cat)).userAgent("Mozilla" ).timeout(0).get();
- Element element1 = doc1.select("table.messagetable td.messCase2 div.left" ).first();
- String titre1 = element1.text();
- return titre1;
- }
- }
|
anbreizh a écrit :
Tu veux pas faire un pastebin avec la liste complète non ? Sinon puisque tu as l'air de t'emmerder, j'ai des "axes d'amélioration" pour ton soft :
- Garder les stats en mémoire et ne pouvoir rafraichir que les pages non-indexées depuis la dernière fois
- Faire des stats sémantiques et obtenir un rapport signal/bruit pour chaque intervenant
|
Si tu veux
Spoiler :
Liste des pseudos : 1/ 12232 -> Publicité
2/ 9077 -> TheCreator
3/ 8063 -> am7
4/ 8029 -> John Oldma?n
5/ 8002 -> KaiserCz
6/ 7872 -> macareu
7/ 6389 -> biloo
8/ 6296 -> gamer-fou
9/ 6225 -> wade
10/ 6172 -> charli323
11/ 5644 -> Coq
12/ 4968 -> Msieurdams
13/ 4829 -> c'est_pas_?ma_faute
14/ 4678 -> nonosore
15/ 4616 -> ZeMrHyde
16/ 4538 -> newbie_mas?ter
17/ 4351 -> crazybiscu?it78
18/ 4288 -> Ydalb
19/ 3882 -> duckxks
20/ 3807 -> seu
21/ 3605 -> xCt
22/ 3549 -> STANcw
23/ 3033 -> Rober_le_P?erver
24/ 2958 -> vangovango
25/ 2895 -> FlatFab
26/ 2835 -> gremi
27/ 2743 -> kamibus
28/ 2625 -> cosmospiri?t
29/ 2381 -> Carbon'R
30/ 2234 -> fabien1176
31/ 2156 -> Kryone
32/ 2109 -> MC-JGabin
33/ 1975 -> Graund-Vei?aijor
34/ 1969 -> Baguep1
35/ 1848 -> Dodol
36/ 1795 -> Ecco
37/ 1771 -> Logicsyste?m360
38/ 1770 -> H3L0
39/ 1711 -> gig-gic
40/ 1690 -> Klm
41/ 1688 -> La_Nouille
42/ 1651 -> shenobie
43/ 1640 -> nikkoneo
44/ 1616 -> typhoon006
45/ 1595 -> le hibou
46/ 1562 -> Naxos
47/ 1419 -> yorfdog
48/ 1390 -> Subarashi
49/ 1358 -> Aubade
50/ 1342 -> XPaY
51/ 1316 -> raphdasout?h
52/ 1302 -> N-Mi
53/ 1293 -> Nanab
54/ 1241 -> lba_gege
55/ 1233 -> RedMaxx
56/ 1200 -> macdriverz
57/ 1187 -> calimeropi?erro
58/ 1181 -> magicien96
59/ 1175 -> soulmanto
60/ 1144 -> Zolki3n
61/ 1127 -> Mr Marron ?derriere
62/ 1094 -> Bakk15
63/ 1061 -> Adrien54
64/ 1052 -> aethyc
65/ 1020 -> Jokeur
66/ 1019 -> lapattefol?le
67/ 1011 -> valentin
68/ 864 -> Stylken
69/ 857 -> le zombie
70/ 845 -> freejuga
71/ 835 -> testostezo?r
72/ 762 -> l0g4n
73/ 761 -> Patchou
74/ 739 -> Gam'1
75/ 714 -> frenchdav
76/ 697 -> cguignol
77/ 685 -> Stone_Isla?nd
78/ 660 -> NGCubeur
79/ 632 -> scapman
80/ 613 -> math3006
81/ 606 -> Pr3ssur3
82/ 569 -> Quich
83/ 556 -> st_machine
84/ 556 -> tr3nt
85/ 513 -> outlaw0013
86/ 508 -> lanimal2
87/ 507 -> Atropos
88/ 504 -> Furiouss
89/ 488 -> kida
90/ 483 -> joulpouill?e
91/ 479 -> anbreizh
92/ 468 -> Sk4
93/ 459 -> nano59650
94/ 423 -> Jean de Tu?les
95/ 398 -> saba93
96/ 386 -> PeNNeR
97/ 375 -> radioactif
98/ 373 -> felinkinki?n
99/ 363 -> kolian
100/ 362 -> jix
101/ 361 -> Random Dud?e
102/ 355 -> hey_popey
103/ 350 -> Amonchakai
104/ 344 -> Drpepers
105/ 342 -> Zenway
106/ 339 -> ca m'gaaav?e
107/ 337 -> Roger01
108/ 335 -> pilef
109/ 332 -> Skyline95
110/ 325 -> grojulius
111/ 318 -> Hulk_
112/ 304 -> J-Kay
113/ 301 -> nekromantt?iK
114/ 299 -> wolowizard
115/ 291 -> Southbank
116/ 286 -> LaSolution
117/ 282 -> niku
118/ 281 -> Okocedion
119/ 280 -> Skip'
120/ 278 -> Toper Harl?ey1
121/ 273 -> Tilk-SG1
122/ 271 -> bad_
123/ 270 -> Spartou
124/ 268 -> Personne
125/ 255 -> Fender
126/ 255 -> fenrir1
127/ 247 -> abdrx
128/ 247 -> logman
129/ 246 -> the Bloodh?ound Gang
130/ 238 -> homme des ?bois
131/ 230 -> charask8
132/ 225 -> marcoluni
133/ 224 -> xibos
134/ 217 -> Erwann Dit? Flo
135/ 216 -> dark-nico
136/ 212 -> [Ben]
137/ 212 -> mylise
138/ 209 -> django
139/ 207 -> moquette
140/ 205 -> corto
141/ 202 -> Elessar777
142/ 201 -> spartacus
143/ 193 -> LeRiton
144/ 193 -> billah2
145/ 190 -> HoM3r17
146/ 180 -> didier1809
147/ 170 -> bulfire
148/ 169 -> alieN.
149/ 168 -> fun_olivie?r
150/ 151 -> batcha
151/ 147 -> Bastian
152/ 138 -> dj pone
153/ 135 -> bigboss_91
154/ 130 -> theperco
155/ 121 -> jeambo
156/ 118 -> khariboo
157/ 114 -> Surian
158/ 111 -> kenrio
159/ 110 -> Ziderm
160/ 109 -> fa_tou
161/ 109 -> stripsky
162/ 103 -> Gamin85
163/ 101 -> xdc360
164/ 100 -> KillMe
165/ 100 -> g@mbit
166/ 98 -> CBRS
167/ 97 -> belette24
168/ 93 -> baggers
169/ 92 -> kunoeil
170/ 83 -> -vigor-
171/ 82 -> little28
172/ 80 -> picardien
173/ 78 -> Naproxen
174/ 75 -> BatouChou
175/ 71 -> fret6
176/ 71 -> le_singe
177/ 68 -> Lagaffe59
178/ 66 -> beufemisat?eur
179/ 65 -> zilouw
180/ 63 -> erase
181/ 60 -> thepilot64
182/ 57 -> Gon29
183/ 54 -> mirzmirz
184/ 52 -> izn0
185/ 51 -> Big Blue
186/ 50 -> jeffk_
187/ 47 -> Prod74
188/ 44 -> fumble
189/ 42 -> schmurtz
190/ 41 -> Shroom01
191/ 40 -> Mdkart
192/ 39 -> bigweep
193/ 38 -> Enikka
194/ 38 -> wolm
195/ 36 -> julius_90
196/ 35 -> Nabou
197/ 35 -> scarymovie
198/ 34 -> Domicron
199/ 34 -> chtivain
200/ 33 -> the-monk
201/ 31 -> Modération
202/ 31 -> bauer_atti?tude
203/ 31 -> canarvador
204/ 31 -> themotar81
Posté le 15-10-2012 à 23:52:24 |
J'avais mis le paramètre min post à 30
Pour le reste des fonctionnalités je verrais si j'ai pas de fleme
désolé pour le long post  |