> ps-ok just discovered plucker is creating new unfiled memos... one per url > copied; so i think the above is still valid-but if i find time i can make > a script to parse the memos :-)
Or use the attached, from Mike. /d
/* pluckerlinks - Download Plucker links and put them in a html doc * * Copyright (c) 2001, Michael Nordström <[EMAIL PROTECTED]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "pi-source.h" #include "pi-socket.h" #include "pi-memo.h" #include "pi-dlp.h" #define PILOTPORT "/dev/pilot" #define VERSION "0.1" #define URL_SIZE 255 struct node { char url[URL_SIZE]; struct node *next; }; static struct node *head = NULL; static struct node *last = NULL; void add_node(char *url) { struct node *p; struct node *new_node; /* Traverse through list to check if url already exists */ for (p = head; p != NULL; p = p->next) if (strcmp(url, p->url) == 0) break; if (p == NULL) { new_node = (struct node *) malloc(sizeof(struct node)); strncpy(new_node->url, url, URL_SIZE); if (head == NULL) head = new_node; else last->next = new_node; last = new_node; } } void store_data(char *text) { char *begin; char *end; if (strncmp(text, "Plucker URLs", 12) == 0) { /* Remove header */ text = strchr(text, '\n') + 1; /* Get links */ for (begin = text, end = strchr(begin, '\n'); end != NULL; end = strchr(begin, '\n')) { begin[end - begin] = '\0'; add_node(begin); begin = end + 1; } add_node(begin); } } void write_data(void) { struct node *p; fprintf(stdout, "<html>\n<head>\n<title>Plucker Links</title>\n</head>\n<body>\n"); while (head != NULL) { p = head->next; fprintf(stdout, "<a href=\"%s\">%s</a><br>\n", head->url, head->url); free(head); head = p; } fprintf(stdout, "</body>\n</html>\n"); } int main(int argc, char *argv[]) { struct pi_sockaddr addr; struct PilotUser user; struct MemoAppInfo mai; unsigned char buffer[65535]; char appblock[65535]; int db; int socket; int i; int result; if (getenv("PILOTPORT")) { strncpy(addr.pi_device, getenv("PILOTPORT"), sizeof(addr.pi_device)); } else { strncpy(addr.pi_device, PILOTPORT, sizeof(addr.pi_device)); } fprintf(stderr, "Please insert Pilot in cradle on %s and press HotSync button.\n", addr.pi_device); socket = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP); if (socket == 0) { perror("pi_socket"); exit(1); } addr.pi_family = PI_AF_SLP; result = pi_bind(socket, (struct sockaddr *) &addr, sizeof(addr)); if (result == -1) { perror("pi_bind"); exit(1); } result = pi_listen(socket, 1); if (result == -1) { perror("pi_listen"); exit(1); } socket = pi_accept(socket, 0, 0); if (socket == -1) { perror("pi_accept"); exit(1); } dlp_ReadUserInfo(socket, &user); dlp_OpenConduit(socket); /* Open the Memo Pad's database, store access handle in db */ if (dlp_OpenDB(socket, 0, 0x80 | 0x40, "MemoDB", &db) < 0) { fprintf(stderr, "Unable to open MemoDB"); dlp_AddSyncLogEntry(socket, "Unable to open MemoDB.\n"); exit(1); } dlp_ReadAppBlock(socket, db, 0, (unsigned char *) appblock, 65535); unpack_MemoAppInfo(&mai, (unsigned char *) appblock, 65535); i = 0; for (;;) { struct Memo m; int attr; int category; // int error; int len; len = dlp_ReadRecordByIndex(socket, db, i++, buffer, 0, 0, &attr, &category); if (len < 0) break; /* Skip deleted records */ if ((attr & dlpRecAttrDeleted) || (attr & dlpRecAttrArchived)) continue; unpack_Memo(&m, buffer, len); if (strncmp(mai.category.name[category], "Plucker", 7) == 0) { store_data(m.text); } fprintf(stderr, "."); } fprintf(stderr, "\n"); write_data(); /* Close the database */ dlp_CloseDB(socket, db); dlp_AddSyncLogEntry(socket, "Read Plucker link data.\n"); pi_close(socket); return 0; }