Example usage for twitter4j MediaEntity getId

List of usage examples for twitter4j MediaEntity getId

Introduction

In this page you can find the example usage for twitter4j MediaEntity getId.

Prototype

long getId();

Source Link

Document

Returns the id of the media.

Usage

From source file:com.github.jcustenborder.kafka.connect.twitter.StatusConverter.java

License:Apache License

static Struct convertMediaEntity(MediaEntity mediaEntity) {
    return new Struct(SCHEMA_MEDIA_ENTITY).put("Id", mediaEntity.getId()).put("Type", mediaEntity.getType())
            .put("MediaURL", mediaEntity.getMediaURL()).put("Sizes", convertSizes(mediaEntity.getSizes()))
            .put("MediaURLHttps", mediaEntity.getMediaURLHttps())
            .put("VideoAspectRatioWidth", mediaEntity.getVideoAspectRatioWidth())
            .put("VideoAspectRatioHeight", mediaEntity.getVideoAspectRatioHeight())
            .put("VideoDurationMillis", mediaEntity.getVideoDurationMillis())
            .put("VideoVariants", convert(mediaEntity.getVideoVariants()))
            .put("ExtAltText", mediaEntity.getExtAltText()).put("URL", mediaEntity.getURL())
            .put("Text", mediaEntity.getText()).put("ExpandedURL", mediaEntity.getExpandedURL())
            .put("Start", mediaEntity.getStart()).put("End", mediaEntity.getEnd())
            .put("DisplayURL", mediaEntity.getDisplayURL());
}

From source file:org.xmlsh.twitter.util.TwitterWriter.java

License:BSD License

private void write(String localName, MediaEntity m) throws XMLStreamException {
    startElement(localName);//from w ww .  j ava  2 s .  c  o m
    attribute("display-url", m.getDisplayURL());
    attribute("end", m.getEnd());
    attribute("expanded-url", m.getExpandedURL().toString());
    attribute("id", m.getId());
    attribute("media-url", m.getMediaURL().toString());
    attribute("media-url-https", m.getMediaURLHttps().toString());

    attribute("start", m.getStart());
    attribute("url", m.getURL().toString());
    Set<Entry<Integer, Size>> sizes = m.getSizes().entrySet();
    for (Entry<Integer, Size> s : sizes) {
        startElement("size");
        attribute("height", s.getValue().getHeight());
        attribute("width", s.getValue().getWidth());
        attribute("resize", s.getValue().getResize());
        endElement();

    }
}