Access the Facebook //connect.facebook.net/en_US/fbevents.js with C# - c#

I am working on pulling news and events to display in my Universal Windows Platform Application (UWP) using C# and have the Facebook SDK installed. The company uses the script below to access the information and display it on their log in website.
!function(b,e,f,g,a,c,d){b.fbq||(a=b.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},b._fbq||(b._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],c=e.createElement(f),c.async=!0,c.src=g,d=e.getElementsByTagName(f)[0],d.parentNode.insertBefore(c,d))}(window,document,"script","//connect.facebook.net/en_US/fbevents.js");fbq("init","1446863745630648");fbq("track","PageView");
As you can see from the script they are using //connect.facebook.net/en_us/fbevents.js file to store the events. Is there a way I can access and read this file?

did you click my link above?? starting a url with // means that a page in http will prepend http, and a page in https will prepend https to it.. See stackoverflow.com/questions/11881054/… – mentat 3 hours ago

Related

How to access XML file on employee sharepoint portal?

Body
Hi guys. I'll be rather brief if I can so here goes.
I made this app in C# that goes onto my employee portal and automatically gets my shifts for me every 30 minutes my using a web browser control and then it reads the HTML data from that and generates a calendar for me and also provides automated alerts.
Issue
Problem is that this web browser uses IE (yeesh help me) and it doesn't work with all parts of the site. I have done some digging around on the site and I found where the ASP site gets the data from: An XML sheet somewhere on the server. I can access this XML sheet, but only if I'm logged in (please see the attached images for more information).
Current solution
So my question is this: How do I actually login to this area?
I could login using the webbrowser and then download the XML using that, but it's too slow and too old, so is there a way I can pass my credentials through?
The URL is like this "https://www.mycoles.com.au/api/rosters/nextweek" -- I don't see any thing like ?name=myname ?pass=mypassword... soo yea. (I'm a bit new).
Further details:
Application language: C#.
Current technology: Windows forms applications/ IE web browser control.
Site backend: Microsoft Sharepoint.
Anything I'm missing? Please ask..?
Attached content
Mycoles XML Logged in
Mycoles XML Access Denied
Update:
So after a while of searching and examining the site, I tried to access the data with a c# webbrowser and it didn't work. It said that it can't download the data, however chrome is able to. Odd. I'm not sure it is an XML file anymore, rather a request and I don't have enough knowledge to work with this, so pointers anyone? Check this site out https://www.mycoles.com.au/api/rosters/nextweek and tell me what you think it is please. Thanks in advance... :)
SharePoint supports different forms of authentication. Out of the box, Active Directory-based single sign-on is provided, and forms-based (username, password) authentication can be configured.
Typically, organizations use AD SSO for its simplicity. If, once you open your desktop browser and navigate to a SharePoint site, you don't have to enter any credentials and are just logged in, then it's most likely this case. This can be either Kerberos or NTLM. The HttpWebRequest class supports both these methods.

C# - Edit OneNote Notebook on SharePoint using REST API

I would like to edit a OneNote NoteBook which is stored in a SharePoint Document Libary via a C# Console Application (because i want to use it to batch input pages into a notebook form a Windows 7 machine).
Url looks like this:
http_s://COMPANY.sharepoint.com/sites/SITE_ID/Documents/_New%20Tool/NOTEBOOK_NAME?d=SOME_ID
So i found this documentation for the OneNote REST API: One Note Api, and i have two questions:
How do i get/request the Bearer Token? SDKs for this seem to be only available for Universal Windows Applications
How do i get the correct API URI? As it states here i need some IDs for the URI, but i do not know which ones to use.
If anyone has any "quick start code" to begin with or a blog post, that would be great. The official examples on GitHub do not seem to be fitting my needs...
If you want to get a Bearer token from a console app, here are your options:
Get a token from somewhere else (e.g. another app that gets tokens) and temporarily copy it to your console app
Display (via a web control/browser) the sign in flow and extract the token from it into the console app. The user has to see the sign in UI at least once - there is no way around this unfortunately. The best example I can find of this is the following: https://github.com/googlesamples/oauth-apps-for-windows/tree/master/OAuthConsoleApp. You'd just have to change the URLs/scopes/AppId.
I'd suggest going with (1) or a different route (windows universal app), but if you do need it to be a console app... you'll need to essentially show a web control/browser with the sign in URL, then parse the code out of it once the user has signed in (or have the user paste it in).
Once you have the bearer token, you can read our blog post on how to use FromUrl to extract/edit content from a site.

Get Live updates from Webpage using C# WebClient

I am developing a Windows Phone app in which I am parsing a webpage from my website. Where some games score updated live, like in cricinfo. Anybody tell me how I sync my webpage with my windows phone WebClient request so that I get updated score wihtout request or refershing in my windows phone app. I am using HTML agility pack and Webclient for parsing html page of mine site.
If the webpage is hosted by a third-party which seems to be the case. Except if there is some kind of RSS-Flow you will have to manually refresh regulary your application.
So all you have to do, is refreshing the information inside some loop with a defined interval.
If the webpage is hosted by you, I suggest using some kind of webservice to recover such information.

integrate facebook comment box to xaml (windows 8 store apps) C#

I am trying to embed Facebook comment box in a windows 8 store app. Is it possible to directly integrate the comment box or are there any other alternative solutions?
What I am trying now >>>> create a web page and add the Facebook comment box to webpage. Then access the webpage that I created through a Webview control. But when I try to login to Facebook using the comment box's link, it will not open the login dialogue inside the webview but it opens the browser where my windows 8 Store app pulled to the background.
I would recommend that you use the Facebook API, as recommended by another SO user answering a similar question
There is a Facebook API for Windows 8
You can find an example on Github here
I haven't tried this API, but did a WPF app using a similar API and it's usually straight forward.
If you would like to, and I know you didn't ask about that - this is just a tip, there is a web authentication broker in the WinRT API's to enable single sign on (SSO) connections to OAuth providers like Facebook etc.
You can find a sample here
Hope this helps, best of luck.

Facebook Connect and .NET

I have an ASP.NET application and a Windows Service. My ASP.NET application allows for users to allow the application to connect with Facebook. If a user has connected the application with Facebook, the Windows Service will later (sometimes much later) post a message on the user's News Feed. I have two questions:
What information do I need to collect from Facebook?
How do I collect that information?
I know that I will need to save some information back to a database that both the ASP.NET application and the Windows Service can access. I have this approach working with Twitter. But I am trying to figure out how to do it with Facebook without much luck.
Thank you for your help.
You're basically limited to the list of "ids" in terms of data you can "save back to a database". For example, on a connect site, you cannot store their "name" or "about" for more than 24 hours:
http://wiki.developers.facebook.com/index.php/Storable_Data
To actually get the data you'll want to use one of the following API methods:
http://wiki.developers.facebook.com/index.php/Users.getInfo
http://wiki.developers.facebook.com/index.php/Users.getStandardInfo
More than likely, getInfo as getStandardInfo returns you cannot display publicly. You'll of course need to use Facebook Connect to first authenticate the user, then you can query the API using Javascript or an ASP.NET FB library to get API results. You'll find a load of client libraries here:
http://wiki.developers.facebook.com/index.php/Client_Libraries
http://wiki.developers.facebook.com/index.php/ASP.NET

Categories

Resources