'Return the timestamp and last_read_location'

def get_bookmark_data(self):

    from calibre.ebooks.metadata.mobi import StreamSlicer
    user_notes = {}
    if (self.bookmark_extension == 'mbp'):
        MAGIC_MOBI_CONSTANT = 150
        with lopen(self.path, 'rb') as f:
            stream = StringIO(f.read())
            data = StreamSlicer(stream)
            (self.timestamp,) = unpack('>I', data[36:40])
            (bpar_offset,) = unpack('>I', data[78:82])
            lrlo = (bpar_offset + 12)
            self.last_read = int(unpack('>I', data[lrlo:(lrlo + 4)])[0])
            self.last_read_location = ((self.last_read / MAGIC_MOBI_CONSTANT) + 1)
            (entries,) = unpack('>I', data[74:78])
            bpl = (bpar_offset + 4)
            (bpar_len,) = unpack('>I', data[bpl:(bpl + 4)])
            bpar_len += 8
            eo = (bpar_offset + bpar_len)
            current_entry = 1
            sig = data[eo:(eo + 4)]
            previous_block = None
            while (sig == 'DATA'):
                text = None
                entry_type = None
                (rec_len,) = unpack('>I', data[(eo + 4):(eo + 8)])
                if (rec_len == 0):
                    current_block = 'empty_data'
                elif (data[(eo + 8):(eo + 12)] == 'EBAR'):
                    current_block = 'data_header'
                    (location,) = unpack('>I', data[(eo + 52):(eo + 56)])
                else:
                    current_block = 'text_block'
                    if (previous_block == 'empty_data'):
                        entry_type = 'Note'
                    elif (previous_block == 'data_header'):
                        entry_type = 'Highlight'
                    text = data[(eo + 8):((eo + 8) + rec_len)].decode('utf-16-be')
                if entry_type:
                    displayed_location = ((location / MAGIC_MOBI_CONSTANT) + 1)
                    user_notes[location] = dict(id=self.id, displayed_location=displayed_location, type=entry_type, text=text)
                eo += (rec_len + 8)
                current_entry += 1
                previous_block = current_block
                sig = data[eo:(eo + 4)]
            while (sig == 'BKMK'):
                (end_loc,) = unpack('>I', data[(eo + 16):(eo + 20)])
                if ((end_loc in user_notes) and ((user_notes[end_loc]['type'] == 'Highlight') or (user_notes[end_loc]['type'] == 'Note'))):
                    (start,) = unpack('>I', data[(eo + 8):(eo + 12)])
                    user_notes[start] = user_notes[end_loc]
                    '\n                                                                                                print    "    %s:    swapping    0x%x    (%d)    to    0x%x    (%d)"    %    (user_notes[end_loc][\'type\'],\n                                                                                                                                                                                                                                                                                end_loc,\n                                                                                                                                                                                                                                                                                end_loc/MAGIC_MOBI_CONSTANT    +    1,\n                                                                                                                                                                                                                                                                                start,\n                                                                                                                                                                                                                                                                                start//MAGIC_MOBI_CONSTANT    +    1)\n                                                                                                '
                    user_notes[start]['displayed_location'] = ((start / MAGIC_MOBI_CONSTANT) + 1)
                    user_notes.pop(end_loc)
                elif (end_loc != self.last_read):
                    displayed_location = ((end_loc / MAGIC_MOBI_CONSTANT) + 1)
                    user_notes[(end_loc - 1)] = dict(id=self.id, displayed_location=displayed_location, type='Bookmark', text=None)
                (rec_len,) = unpack('>I', data[(eo + 4):(eo + 8)])
                eo += (rec_len + 8)
                sig = data[eo:(eo + 4)]
    elif (self.bookmark_extension == 'tan'):
        from calibre.ebooks.metadata.topaz import get_metadata as get_topaz_metadata
        def get_topaz_highlight(displayed_location):
            book_fs = self.path.replace(('.%s' % self.bookmark_extension), ('.%s' % self.book_format))
            with lopen(book_fs, 'rb') as f2:
                stream = StringIO(f2.read())
                mi = get_topaz_metadata(stream)
            my_clippings = self.path
            split = (my_clippings.find('documents') + len('documents/'))
            my_clippings = (my_clippings[:split] + 'My    Clippings.txt')
            try:
                with lopen(my_clippings, 'r') as f2:
                    marker_found = 0
                    text = ''
                    search_str1 = ('%s' % mi.title)
                    search_str2 = ('-    Highlight    Loc.    %d' % displayed_location)
                    for line in f2:
                        if (marker_found == 0):
                            if line.startswith(search_str1):
                                marker_found = 1
                        elif (marker_found == 1):
                            if line.startswith(search_str2):
                                marker_found = 2
                        elif (marker_found == 2):
                            if line.startswith('=========='):
                                break
                            text += line.strip()
                    else:
                        raise Exception('error')
            except:
                text = '(Unable    to    extract    highlight    text    from    My    Clippings.txt)'
            return text
        MAGIC_TOPAZ_CONSTANT = 33.33
        self.timestamp = os.path.getmtime(self.path)
        with lopen(self.path, 'rb') as f:
            stream = StringIO(f.read())
            data = StreamSlicer(stream)
            self.last_read = int(unpack('>I', data[5:9])[0])
            self.last_read_location = ((self.last_read / MAGIC_TOPAZ_CONSTANT) + 1)
            (entries,) = unpack('>I', data[9:13])
            current_entry = 0
            e_base = 13
            while (current_entry < entries):
                (location,) = unpack('>I', data[(e_base + 2):(e_base + 6)])
                text = None
                (text_len,) = unpack('>I', data[(e_base + 10):(e_base + 14)])
                (e_type,) = unpack('>B', data[(e_base + 1)])
                if (e_type == 0):
                    e_type = 'Bookmark'
                elif (e_type == 1):
                    e_type = 'Highlight'
                    text = get_topaz_highlight(((location / MAGIC_TOPAZ_CONSTANT) + 1))
                elif (e_type == 2):
                    e_type = 'Note'
                    text = data[(e_base + 16):((e_base + 16) + text_len)]
                else:
                    e_type = 'Unknown    annotation    type'
                displayed_location = ((location / MAGIC_TOPAZ_CONSTANT) + 1)
                user_notes[location] = dict(id=self.id, displayed_location=displayed_location, type=e_type, text=text)
                if (text_len == 4294967295):
                    e_base = (e_base + 14)
                else:
                    e_base = (((e_base + 14) + 2) + text_len)
                current_entry += 1
            for location in user_notes:
                if (location == self.last_read):
                    user_notes.pop(location)
                    break
    elif (self.bookmark_extension == 'pdr'):
        self.timestamp = os.path.getmtime(self.path)
        with lopen(self.path, 'rb') as f:
            stream = StringIO(f.read())
            data = StreamSlicer(stream)
            self.last_read = int(unpack('>I', data[5:9])[0])
            (entries,) = unpack('>I', data[9:13])
            current_entry = 0
            e_base = 13
            self.pdf_page_offset = 0
            while (current_entry < entries):
                "\n                                                                                location,    =    unpack('>I',    data[e_base+2:e_base+6])\n                                                                                text    =    None\n                                                                                text_len,    =    unpack('>I',    data[e_base+0xA:e_base+0xE])\n                                                                                e_type,    =    unpack('>B',    data[e_base+1])\n                                                                                if    e_type    ==    0:\n                                                                                                e_type    =    'Bookmark'\n                                                                                elif    e_type    ==    1:\n                                                                                                e_type    =    'Highlight'\n                                                                                                text    =    get_topaz_highlight(location/MAGIC_TOPAZ_CONSTANT    +    1)\n                                                                                elif    e_type    ==    2:\n                                                                                                e_type    =    'Note'\n                                                                                                text    =    data[e_base+0x10:e_base+0x10+text_len]\n                                                                                else:\n                                                                                                e_type    =    'Unknown    annotation    type'\n\n                                                                                if    self.book_format    in    ['tpz','azw1']:\n                                                                                                displayed_location    =    location/MAGIC_TOPAZ_CONSTANT    +    1\n                                                                                elif    self.book_format    ==    'pdf':\n                                                                                                #    ***    This    needs    implementation\n                                                                                                displayed_location    =    location\n                                                                                user_notes[location]    =    dict(id=self.id,\n                                                                                                                                                                                                displayed_location=displayed_location,\n                                                                                                                                                                                                type=e_type,\n                                                                                                                                                                                                text=text)\n                                                                                if    text_len    ==    0xFFFFFFFF:\n                                                                                                e_base    =    e_base    +    14\n                                                                                else:\n                                                                                                e_base    =    e_base    +    14    +    2    +    text_len\n                                                                                current_entry    +=    1\n                                                                                "
                (pdf_location,) = unpack('>I', data[(e_base + 1):(e_base + 5)])
                (label_len,) = unpack('>H', data[(e_base + 5):(e_base + 7)])
                location = int(data[(e_base + 7):((e_base + 7) + label_len)])
                displayed_location = location
                e_type = 'Bookmark'
                text = None
                user_notes[location] = dict(id=self.id, displayed_location=displayed_location, type=e_type, text=text)
                self.pdf_page_offset = (pdf_location - location)
                e_base += (7 + label_len)
                current_entry += 1
            self.last_read_location = (self.last_read - self.pdf_page_offset)
    else:
        print ('unsupported    bookmark_extension:    %s' % self.bookmark_extension)
    self.user_notes = user_notes
