FORUMS

Removing Facebook HTC Data

1,155 posts
Thanks Meter: 347
 
By Ozark_8125, Senior Member on 27th July 2010, 06:31 PM
Post Reply Email Thread
Is there a way to easily remove the facebook tags on contacts in outlook? it's the stuff that says :

<HTCData><!-- Please do not modify -->
<Facebook>id:xxxxxx/friendof:xxxxxxxxxxx</Facebook>
</HTCData>


Thanks!
10th November 2010, 05:57 PM |#2  
Member
Thanks Meter: 1
 
Donate to Me
More
Yes PLEASE? I don't use a Sense ROM anymore and this is annoying!
10th December 2010, 07:01 PM |#3  
Junior Member
Thanks Meter: 3
 
More
I don't even have this phone anymore. Maybe I will write something to do this for us.
10th December 2010, 11:15 PM |#4  
Junior Member
Thanks Meter: 3
 
More
HTC tag removal in contact notes!
I just sat down on my break and created this code to strip out the HTC tags from the contact notes:

Code:
Sub HTCbGone()
   Dim objContactsFolder As Outlook.MAPIFolder
   Dim objContacts As Outlook.Items
   Dim objContact As Object
   Dim StartPos As Integer
   Dim EndPos As Integer
   Dim iCount As Integer

   ' Specify with which contact folder to work
   Set objContactsFolder = _
      Session.GetDefaultFolder(olFolderContacts)
   Set objContacts = objContactsFolder.Items

   iCount = 0

   ' Process the changes
   For Each objContact In objContacts
      If TypeName(objContact) = "ContactItem" Then
         StartPos = InStr(objContact.Body, "<HTCData>")
         EndPos = InStr(objContact.Body, "</HTCData>") + 10
         If StartPos > 0 Then
            If StartPos = 1 Then
                If Len(EndPos) > EndPos + 1 Then
                    objContact.Body = Mid(objContact.Body, EndPos + 1)
                Else
                    objContact.Body = ""
                End If
            Else
                If Len(EndPos) > EndPos + 1 Then
                    objContact.Body = Left(objContact.Body, StartPos = 1)
                Else
                    objContact.Body = Left(objContact.Body, StartPos - 1) & Mid(objContact.Body, EndPos + 1)
                End If
            End If
            iCount = iCount + 1
            objContact.Save
         
         End If
      End If
   Next

   ' Display the results
   MsgBox "Number of contacts updated:" & Str$(iCount), , _
      "HTCbGone Finished"

   ' Clean up
   Set objContact = Nothing
   Set objContacts = Nothing
   Set objContactsFolder = Nothing

End Sub
To run this, I opened Outlook. Selected Macro(s) from the Tools pull-down menu (or press [ALT+F8]). Created a new Macro called HTCbGone and pasted this code over everything. Then I just ran it.

Use at your own risk.

Happy scripting,

GinoRP
The Following 3 Users Say Thank You to ginorp For This Useful Post: [ View ] Gift ginorp Ad-Free
31st December 2010, 04:08 PM |#5  
Junior Member
Thanks Meter: 1
 
More
THANK YOU!!!! (I only type in all caps 2 or 3 times a year) If HTC was a person I would kick him in the teeth because of what they have done to my 500+ contacts in my Microsoft Exchange account.

How could the people at HTC justify code that puts notes on contacts only invisible to a HTC device and visible everywhere else?? How could they think that would annoy no one? Blows my effing mind.
The Following User Says Thank You to charly.root For This Useful Post: [ View ] Gift charly.root Ad-Free
2nd January 2011, 12:11 AM |#6  
patrickvh's Avatar
Junior Member
Thanks Meter: 0
 
More
Kinda thanks but for me it did not work.
I made and run the macro.
Then I noticed some things got lost though!

Before I began I made a copy of the contacts folder in Outlook (recommended!).
I used the "modified" tab to see what contacts where changed when.
There was an extra URL in the note position for a contact which I put there earlier today.
After running the macro the Facebook data was gone but so was the URL.
Because it changed many contacts I did not bother to look further if other things gotten lost but rather just emptied the folder and restored from backup folder.

I am do work with DB and such but did not find anything special in the script which could explain my output.
30th May 2011, 09:53 PM |#7  
DeMiNe0's Avatar
Senior Member
Thanks Meter: 98
 
More
Sorry to bring up a dead thread, but is there a way to do this without outlook?
7th July 2011, 10:19 PM |#8  
mightyoj's Avatar
Member
Thanks Meter: 2
 
More
i am still interested as well- can anyone come up with a better way not using outlook?
14th October 2011, 07:09 AM |#9  
mredmond2012's Avatar
Member
Flag Oklahoma
Thanks Meter: 14
 
More
Remove HTC Notes Using CSV
Quote:
Originally Posted by DeMiNe0

Sorry to bring up a dead thread, but is there a way to do this without outlook?

I was trying to figure out this very same thing and came across this thread in my searching. I also don't look Outlook, but I found a really simple, quick, and effective way to manually get rid of all those pesky HTC notes in under five minutes, for those that don't use Outlook:

1) Go into the contacts view in Gmail
2) Click the "More" dropdown box and select "Export"
3) Ensure that the "All Contacts" option is selected, choose the "Outlook CSV format," and export
4) After the file downloads, open it up in Excel (or your choice spreadsheet program)
5) Find the column labeled "Notes," and then just scroll down and clear all the cells with HTC data in them
6) Save the file, ensuring it is still in CSV format
7) Back in your Google Contact Manager, delete all your contacts
NOTE: Before deleting your contacts you will want to export a Google CSV file of all your contacts for backup. You can also the "More > Restore" feature to go back to a previous point in time if something goes wrong.
8) Import the CSV file you saved in step 6

That's it! Your contact book should be restored to the exact way it was, minus the obnoxious HTC data. With 1,000+ contacts, I was able to do this in about two minutes. Again, be sure you have backups of your contacts or know how to use Google's Restore contacts feature in case something goes wrong, but this should work simply enough. Also, I just selected all the cells in the Notes column and cleared all their data, but if you have any notes saved for any of your contacts, you'll want to scroll through the spreadsheet file and be sure you only delete cells with HTC data.

I hope this helps!

---------- Post added at 01:09 AM ---------- Previous post was at 12:52 AM ----------

You should also be aware that this method may cause you to lose your contacts photos, as well as any joined contacts you have in your Android address book. However, if you want to attach your contacts Facebook photos permanently to their Google contact entry (something HTC's method did not do), you should check out this tool; in just a couple clicks, you can have all those photos matched up again and restored:

[I can't post links yet, but just Google "Facebook Google Contact Sync" and click on the first return. It is a great little tool made by a dev called "Heart of Angel."]
The Following 9 Users Say Thank You to mredmond2012 For This Useful Post: [ View ] Gift mredmond2012 Ad-Free
13th February 2013, 08:41 PM |#10  
david black's Avatar
Senior Member
Flag Indianapolis
Thanks Meter: 85
 
More
Thumbs up
Quote:
Originally Posted by mredmond2012

I was trying to figure out this very same thing and came across this thread in my searching. I also don't look Outlook, but I found a really simple, quick, and effective way to manually get rid of all those pesky HTC notes in under five minutes, for those that don't use Outlook:

1) Go into the contacts view in Gmail
2) Click the "More" dropdown box and select "Export"
3) Ensure that the "All Contacts" option is selected, choose the "Outlook CSV format," and export
4) After the file downloads, open it up in Excel (or your choice spreadsheet program)
5) Find the column labeled "Notes," and then just scroll down and clear all the cells with HTC data in them
6) Save the file, ensuring it is still in CSV format
7) Back in your Google Contact Manager, delete all your contacts

NOTE: Before deleting your contacts you will want to export a Google CSV file of all your contacts for backup. You can also the "More > Restore" feature to go back to a previous point in time if something goes wrong.
8) Import the CSV file you saved in step 6

That's it! Your contact book should be restored to the exact way it was, minus the obnoxious HTC data. With 1,000+ contacts, I was able to do this in about two minutes. Again, be sure you have backups of your contacts or know how to use Google's Restore contacts feature in case something goes wrong, but this should work simply enough. Also, I just selected all the cells in the Notes column and cleared all their data, but if you have any notes saved for any of your contacts, you'll want to scroll through the spreadsheet file and be sure you only delete cells with HTC data.

I hope this helps!

---------- Post added at 01:09 AM ---------- Previous post was at 12:52 AM ----------

You should also be aware that this method may cause you to lose your contacts photos, as well as any joined contacts you have in your Android address book. However, if you want to attach your contacts Facebook photos permanently to their Google contact entry (something HTC's method did not do), you should check out this tool; in just a couple clicks, you can have all those photos matched up again and restored:

[I can't post links yet, but just Google "Facebook Google Contact Sync" and click on the first return. It is a great little tool made by a dev called "Heart of Angel."]

In addition to the thanks button, I think you deserve a "thanks" post. This was so useful and in addition to removing that HTC garbage, I removed all the other data I found unnecessary.
24th April 2013, 03:19 AM |#11  
Junior Member
Thanks Meter: 2
 
More
Remove With a Simple Java Program, If you know Java
Quote:
Originally Posted by Ozark_8125

Is there a way to easily remove the facebook tags on contacts in outlook? it's the stuff that says :

<HTCData><!-- Please do not modify -->
<Facebook>id:xxxxxx/friendof:xxxxxxxxxxx</Facebook>
</HTCData>

Thanks!

I know I am too late to reply this post but I actually searched a solution today and found this post where some one also had same issue.

Using gdata java api I wrote a small program to remove notes from all of your contacts. Maximum 800 (Congifurable) Here is the Java Program :

Code:
import java.net.URL;

import com.google.gdata.client.Query;
import com.google.gdata.client.contacts.ContactsService;
import com.google.gdata.data.PlainTextConstruct;
import com.google.gdata.data.TextContent;
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.ContactFeed;

/**
 * This is a test template
 */

public class ContactNotesCleaner {
 
        public static String feedUrlString = "https COLON SLASH SLASH www DOT google DOT com SLASH m8 SLASH feeds SLASH contacts SLASH default SLASH full";

	public static void main(String[] args) throws Exception {
		// Create a new Contacts service
		ContactsService myService = new ContactsService(<Any App Name>);
		myService.setUserCredentials(<Your Gmail Id>, <Your Password>);
		updateAllContacts(myService);
	}

	public static void updateAllContacts(ContactsService myService) throws Exception {
		URL feedUrl = new URL(feedUrlString);
		Query myQuery = new Query(feedUrl);
		myQuery.setMaxResults(800);
		ContactFeed resultFeed = myService.query(myQuery, ContactFeed.class);
		// Print the results
		System.out.println(resultFeed.getTitle().getPlainText());
		for (ContactEntry entry : resultFeed.getEntries()) {
			if (entry.getContent() != null) {
				updateNotesContent(myService, entry);
			}
		}
	}

	private static void updateNotesContent(ContactsService myService, ContactEntry entry) throws Exception {
		TextContent textContent = (TextContent) entry.getContent();
		if (textContent.getContent() != null) {
			String plainText = textContent.getContent().getPlainText();
			if (plainText != null && plainText.startsWith("<HTCData>")) {
				String newPlainText = "";
				textContent.setContent(new PlainTextConstruct(newPlainText.trim()));
				entry.setContent(textContent);
				URL editUrl = new URL(entry.getEditLink().getHref());
				ContactEntry contactEntry = myService.update(editUrl, entry);
				System.out.println(entry.getName().getFullName().getValue() + " " + "Updated: " + contactEntry.getUpdated().toString());
			}
		}
	}
}
I have executed the above program and tested it. You need gdata lib files:

gdata-media-1.0.jar
gdata-client-meta-1.0.jar
gdata-contacts-3.0.jar
gdata-client-1.0.jar
gdata-contacts-meta-3.0.jar
gdata-core-1.0.jar
guava-14.0.1.jar
gdataplugin.jar -- I am not sure what this jar does, even if it is required or not.

This is a bit complex for some users to run a java program, this way you will not loose the chat invites and other important information of your contact.

Note: Even if I have tested above program 10 times, I would not give any guaranty it will work for you.

- CAM
The Following 2 Users Say Thank You to cmehta82 For This Useful Post: [ View ] Gift cmehta82 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes