7
7
import java .util .Locale ;
8
8
9
9
import chan .content .model .Attachment ;
10
+ import chan .content .model .EmbeddedAttachment ;
10
11
import chan .content .model .FileAttachment ;
11
12
import chan .content .model .Icon ;
12
13
import chan .content .model .Post ;
@@ -179,12 +180,28 @@ public static Post createPost(JsonSerial.Reader reader, SojakpartyChanLocator lo
179
180
case "com" : {
180
181
String comment = reader .nextString ()
181
182
.replaceAll ("%23" , "#" )
182
- .replaceAll ("(?<=<a href=\\ \" )https://jump\\ .kolyma\\ .net/\\ ?" , "" )
183
- .replaceAll ("(?<=<div )class=\\ \" glow" , "style=\\ \" color:#00FE20" )
184
- .replaceAll ("(?<=<span )style=\\ \" text-shadow:0px 0px 40px #fffb00, 0px 0px 2px #fffb00" , "style=\\ \" color:#FFFB00" )
185
- .replaceAll ("(?<=<span )class=\\ \" heading2" , "style=\\ \" color:#2424AD" )
186
- .replaceAll ("(?<=<span )class=\\ \" heading" , "style=\\ \" color:#AF0A0F" )
187
- .replaceAll ("(?<=<span )class=\\ \" quote2" , "style=\\ \" color:#F6750B" );
183
+ .replaceAll ("<div" , "<span" )
184
+ .replaceAll ("</div" , "</span" )
185
+ // gemerald text
186
+ .replaceAll ("<span style=\" background: linear-gradient\\ (to left, red, orange , yellow, green, cyan, blue, violet\\ );-webkit-background-clip: text;-webkit-text-fill-color: transparent;\" ><span class=\" glow\" >(<[^/]*>)*(.*?)</span></span>" ,
187
+ "<span style=\" color:#00FE20\" >$1\uD83D \uDC8E $2 \uD83D \uDC8E </span>" )
188
+ // diamond text
189
+ .replaceAll ("<span style=\" background: linear-gradient\\ (to left, red, orange , yellow, green, cyan, blue, violet\\ );-webkit-background-clip: text;-webkit-text-fill-color: transparent;\" ><span style=\" text-shadow:0px 0px 40px #36d7f7, 0px 0px 2px #36d7f7\" >(<[^/]*>)*(.*?)</span></span>" ,
190
+ "<span style=\" color:#36D7F7\" >$1\uD83D \uDC8E $2 \uD83D \uDC8E </span>" )
191
+ // gold text
192
+ .replaceAll ("<span style=\" background: linear-gradient\\ (to left, red, orange , yellow, green, cyan, blue, violet\\ );-webkit-background-clip: text;-webkit-text-fill-color: transparent;\" ><span style=\" text-shadow:0px 0px 40px #fffb00, 0px 0px 2px #fffb00\" >(<[^/]*>)*(.*?)</span></span>" ,
193
+ "<span style=\" color:#FFFB00\" >$1\uD83C \uDFC6 $2 \uD83C \uDFC6 </span>" )
194
+ // rainbow text
195
+ .replaceAll ("<span style=\" background: linear-gradient\\ (to left, red, orange , yellow, green, cyan, blue, violet\\ );-webkit-background-clip: text;-webkit-text-fill-color: transparent;\" >(<[^/]*>)*(.*?)</span>" ,
196
+ "<span>$1\uD83C \uDF08 $2 \uD83C \uDF08 </span>" )
197
+ .replaceAll ("<span class=\" rotate\" >(<[^/]*>)*(.*?)</span>" ,"<span>$1\uD83D \uDD03 $2 \uD83D \uDD03 </span>" ) // spin text
198
+ .replaceAll ("<span class=\" glow\" >(.*?)</span>" , "<span style=\" color:#00FE20\" >$1</span>" ) // glow text
199
+ .replaceAll ("<span style=\" text-shadow:0px 0px 40px #36d7f7, 0px 0px 2px #36d7f7\" >(.*?)</span>" , "<span style=\" color:#36D7F7\" >$1</span>" ) // blue glow text
200
+ .replaceAll ("<span style=\" text-shadow:0px 0px 40px #fffb00, 0px 0px 2px #fffb00\" >(.*?)</span>" , "<span style=\" color:#FFFB00\" >$1</span>" ) // sneed text
201
+ .replaceAll ("<span class=\" heading\" >(.*?)</span>" ,"<span style=\" color:#AF0A0F\" >$1</span>" ) // red text
202
+ .replaceAll ("<span class=\" heading2\" >(.*?)</span>" ,"<span style=\" color:#2424AD\" >$1</span>" ) // blue text
203
+ .replaceAll ("<span class=\" quote2\" >(.*?)</span>" , "<span style=\" color:#F6750B\" >$1</span>" ) // orange quote
204
+ .replaceAll ("<font color=\" FD3D98\" ><b>(.*?)</b></font>" , "<strong><span style=\" color:#FD3D98\" >$1</span></strong>" ); // pink text
188
205
post .setComment (comment );
189
206
break ;
190
207
}
@@ -243,6 +260,15 @@ public static Post createPost(JsonSerial.Reader reader, SojakpartyChanLocator lo
243
260
}
244
261
break ;
245
262
}
263
+ case "embed" : {
264
+ String embedString = reader .nextString ()
265
+ .replaceAll ("vocaroo\\ .com/embed" , "vocaroo.com" );
266
+ EmbeddedAttachment attachment = EmbeddedAttachment .obtain (embedString );
267
+ if (attachment != null ) {
268
+ attachments .add (attachment );
269
+ }
270
+ break ;
271
+ }
246
272
default : {
247
273
reader .skip ();
248
274
break ;
@@ -251,8 +277,8 @@ public static Post createPost(JsonSerial.Reader reader, SojakpartyChanLocator lo
251
277
}
252
278
if (tim != null && size >= 0 ) {
253
279
attachments .add (0 , createFileAttachment (locator , boardName , tim , ext , filename , size , width , height ));
254
- post .setAttachments (attachments );
255
280
}
281
+ post .setAttachments (attachments );
256
282
if (CommonUtils .equals (post .getIdentifier (), post .getCapcode ())) {
257
283
post .setIdentifier (null );
258
284
}
0 commit comments