Package net.easymodo.asagi.model

Examples of net.easymodo.asagi.model.Post


            throw new ContentParseException("Could not create post " + num , e);
        }

        String exif = this.cleanSimple(this.parseMeta(comment));

        Post post = new Post();
        post.setLink(link);
        post.setType(type);
        post.setMediaOrig(mediaOrig);
        post.setMediaHash(md5);
        post.setMediaFilename(filename);
        post.setMediaSize(mediaSize);
        post.setMediaW(width);
        post.setMediaH(height);
        post.setPreviewOrig(previewOrig);
        post.setPreviewW(tWidth);
        post.setPreviewH(tHeight);
        post.setExif(exif);
        post.setNum(num);
        post.setThreadNum(threadNum);
        post.setOp(op);
        post.setTitle(this.cleanSimple(title));
        post.setEmail(this.cleanLink(email));
        post.setName(this.cleanSimple(name));
        post.setTrip(trip);
        post.setDate(timeStamp);
        post.setComment(this.doClean(comment));
        post.setSpoiler(spoiler);
        post.setDeleted(false);
        post.setSticky(sticky);
        post.setClosed(closed);
        post.setCapcode(capcode);
        post.setPosterHash(posterHash);
        post.setPosterCountry(posterCountry);
        post.setOmitted(omitted);

        return post;
    }
View Full Code Here


        int omImages = 0;
        mat = omImagesPattern.matcher(text);
        if(mat.find()) omImages = Integer.parseInt(mat.group(1));

        Post op = this.parsePost(text, 0);
        Topic thread = new Topic(op.getNum(), omPosts, omImages);
        thread.addPost(op);

        return thread;
    }
View Full Code Here

        }
        if(pj.getTime() == 0) {
            throw new ContentParseException("Could not parse post (post timestamp missing and could not be zero)");
        }

        Post p = new Post();

        if(pj.getFilename() != null) {
            p.setMediaFilename(pj.getFilename() + pj.getExt());
            p.setMediaOrig(pj.getTim() + pj.getExt());
            p.setPreviewOrig(pj.getTim() + "s.jpg");
        }

        String capcode = pj.getCapcode();
        if(capcode != null) capcode = capcode.substring(0, 1).toUpperCase();

        String posterHash = pj.getId();
        if(posterHash != null && posterHash.equals("Developer")) posterHash = "Dev";

        String posterCountry = pj.getCountry();
        if(posterCountry != null && (posterCountry.equals("XX") || posterCountry.equals("A1"))) posterCountry = null;

        p.setType(pj.getExt());
        p.setMediaHash(pj.getMd5());
        p.setMediaSize(pj.getFsize());
        p.setMediaW(pj.getW());
        p.setMediaH(pj.getH());
        p.setPreviewW(pj.getTnW());
        p.setPreviewH(pj.getTnH());
        p.setNum(pj.getNo());
        p.setThreadNum(pj.getResto() == 0 ? pj.getNo() : pj.getResto());
        p.setOp(pj.getResto() == 0);
        p.setTitle(this.cleanSimple(pj.getSub()));
        p.setEmail(pj.getEmail());
        p.setName(this.cleanSimple(pj.getName()));
        p.setTrip(pj.getTrip());
        p.setDate(DateUtils.adjustTimestampEpoch(pj.getTime(), DateUtils.NYC_TIMEZONE));
        p.setComment(this.doClean(pj.getCom()));
        p.setSpoiler(pj.isSpoiler());
        p.setDeleted(false);
        p.setSticky(pj.isSticky());
        p.setClosed(pj.isClosed() && !pj.isArchived());
        p.setArchived(pj.isArchived());
        p.setCapcode(capcode);
        p.setPosterHash(posterHash);
        p.setPosterCountry(posterCountry);
        p.setExif(this.cleanSimple(this.parseMeta(pj.getCom())));

        return p;
    }
View Full Code Here

                            mustRefresh = true;
                            newPosts++;
                        }

                        for(Iterator<Post> it = newTopic.getPosts().iterator(); it.hasNext();) {
                            Post newPost = it.next();

                            // This post was already in topics map. Next post
                            if(fullTopic.findPost(newPost.getNum())) {
                                if(newPost.isOmitted()) it.remove();
                                oldPosts++;
                                continue;
                            }

                            // Looks like it's new
                            // Add the post's num to the full topic, we'll
                            // update it for real with newTopic.
                            fullTopic.addPost(newPost.getNum()); newPosts++;

                            // Comment too long. Click here to view the full text.
                            // This means we have to refresh the full thread
                            if(newPost.isOmitted()) mustRefresh = true;
                        }

                        // Update the time we last hit this thread
                        fullTopic.setLastHit(pageStartTime);
View Full Code Here

TOP

Related Classes of net.easymodo.asagi.model.Post

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.